skip to Main Content

WordPress Code Snippets


How to Disable Schema Markup for Specific Post Types in AIOSEO

This snippet disables schema markup for particular post types, ensuring that the content is not marked up with unnecessary data for search engines.

add_filter( 'aioseo_schema_graph', function ( $schemaGraph, $type ) {
    if ( is_singular( 'custom_post_type' ) ) {
        return [];
    }
    return $schemaGraph;
}, 10, 2 );

I’m a WordPress developer with 10+ years of experience in WooCommerce and custom plugins. I combine technical expertise with design flair to help you create standout, user-friendly websites. Let’s transform your digital presence!

Best WordPress Hosting
Back To Top