Enabling and Disabling Schema Types

DigiFusion includes a comprehensive schema markup system that adds structured data to your website, helping search engines better understand your content. You can control which schema types are enabled or disabled through the WordPress Customizer or using code filters.

Global Schema Markup Control

Navigate to the WordPress Customizer to control schema markup globally:

Go to Appearance > Customize > General > Schema Markup.

Toggle the Enable Schema Markup option to turn schema markup on or off for your entire website.

When disabled, no schema markup will be added to any part of your site.

Available Schema Types

DigiFusion supports the following schema types:

  • Header – Adds schema markup to the site header
  • Footer – Adds schema markup to the site footer
  • Navigation – Adds schema markup to navigation menus
  • Breadcrumb – Adds schema markup to breadcrumb navigation
  • Article – Adds schema markup to article content
  • Blog Post – Adds schema markup to blog post content
  • Person – Adds schema markup for author information
  • Organization – Adds schema markup for company/organization data
  • Main Content – Adds schema markup to main content areas
  • Comment Section – Adds schema markup to comment areas

Disabling Specific Schema Types Using Filters

You can disable specific schema types by adding filters to your child theme’s functions.php file.

Disable All Schema Markup

add_filter( 'digifusion_enable_schema_markup', '__return_false' );

Disable Specific Schema Types

To disable a specific schema type, use the schema type name in the filter:

// Disable header schema markup
add_filter( 'digifusion_enable_schema_markup_header', '__return_false' );

// Disable navigation schema markup
add_filter( 'digifusion_enable_schema_markup_navigation', '__return_false' );

// Disable breadcrumb schema markup
add_filter( 'digifusion_enable_schema_markup_breadcrumb', '__return_false' );

Disable Schema Properties

You can also disable specific schema properties:

// Disable author property
add_filter( 'digifusion_enable_schema_property_author', '__return_false' );

// Disable date published property
add_filter( 'digifusion_enable_schema_property_datePublished', '__return_false' );

Conditional Schema Markup

Disable schema markup on specific pages or post types:

// Disable schema markup on homepage
add_filter( 'digifusion_enable_schema_markup', function( $enabled ) {
    if ( is_front_page() ) {
        return false;
    }
    return $enabled;
});

// Disable article schema on custom post types
add_filter( 'digifusion_enable_schema_markup_article', function( $enabled ) {
    if ( is_singular( 'custom_post_type' ) ) {
        return false;
    }
    return $enabled;
});

Custom Schema Types

Add custom schema types using the filter system:

add_filter( 'digifusion_custom_schema_markup_product', function( $markup, $args ) {
    return 'itemscope="itemscope" itemtype="https://schema.org/Product"';
}, 10, 2 );

Then use the custom schema type in your templates:

echo digifusion_get_schema_markup( 'product' );

The schema markup system automatically checks the theme customizer setting and applies the appropriate filters before outputting any schema markup to your website.