Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Disable Schema plugin breadcrumbs https://schema.press/docs/breadcrumb-output/
<?php //* do not include php tag
/*
* A few ways to disable Schema plugin breadcrumbs json-ld output
*
* @since 1.6.9.5
*/
//------------------- (1)
//
// This will add a filter on `schema_wp_breadcrumb_enabled` that returns false
add_filter( 'schema_wp_breadcrumb_enabled', '__return_false' );
//------------------- (2)
//
// This will add a filter on `schema_wp_breadcrumb_enabled` that returns false
// but allow you to something in the function (see next function #3 for example)
add_filter( 'schema_wp_breadcrumb_enabled', 'schema_wp_breadcrumb_disable_238746' );
/*
* Disable breadcrumbs
*
* @since 1.6.9.5
*/
function schema_wp_breadcrumb_disable_238746( $breadcrumb_enabled ){
return false;
}
//------------------- (3)
//
// This will add a filter on `schema_wp_breadcrumb_enabled` that returns false,
// This example will disable breadcrumbs on WooCommerce
add_filter( 'schema_wp_breadcrumb_enabled', 'schema_wp_breadcrumb_woo_product_disable' );
/*
* Disable breadcrumbs on WooCommerce
*
* @since 1.6.9.5
*/
function schema_wp_breadcrumb_woo_product_disable( $breadcrumb_enabled ){
if ( class_exists( 'woocommerce' ) ) {
if ( is_woocommerce() ) return false;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.