• Hi there,

    I have a problem in some of my pages where Woocommerce creates breadcrumbs schema and conflict with Yoast.
    Do you know how to disable the breadcrumbs schema generation from Woocommerce?

    Cheers,
    Marcello

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Saif

    (@babylon1999)

    Hi there,

    Thank you for reaching out.

    Do you know how to disable the breadcrumbs schema generation from Woocommerce?

    If I understand you correctly, you want to remove the breadcrumbs rendered by WooCommerce.

    I found the following code snippet in this doc, it should take care of it. Please add it to your functions.php file and let us know how it goes. ??

    /**
     * Remove the breadcrumbs 
     */
    add_action( 'init', 'woo_remove_wc_breadcrumbs' );
    function woo_remove_wc_breadcrumbs() {
        remove_action( 'woocommerce_before_main_content', 'woocommerce_breadcrumb', 20, 0 );
    }
    Thread Starter marcello.brunaldi

    (@gamma42)

    Hello Saif and thank you for your reply.

    Do you know by the way if Woocommerce is outputting also the Schema.org breadcrumbs with this piece of code?

    Because maybe your advise is not what I was looking for. My goal is to interrupt the generation of Breadcrumbs markup for rich snippets because I have a feeling that this conflict with Yoast Seo Plugin.

    Talk soon,
    Marcello

    Mirko P.

    (@rainfallnixfig)

    Hello Marcello,

    Thanks for clarifying.

    It sounds a fairly complex development topic but you may want to check out this post in the Yoast SEO support forum and refer to this guide in order to prevent graph pieces from being outputted.

    I’m going to leave this thread open for a bit to see if anyone is able to chime in to help you out.

    You can also visit the WooCommerce Facebook Community group or the #developers channel of the WooCommerce Community Slack.

    We’re lucky to have a great community of open-source developers for WooCommerce, and many of our developers hang out there, as well.

    Cheers.

    Thread Starter marcello.brunaldi

    (@gamma42)

    Hi there,

    I have tried to add this piece of code:`
    `function remove_breadcrumbs_from_schema( $pieces, $context ) {
    return \array_filter( $pieces, function( $piece ) {
    return ! $piece instanceof \Yoast\WP\SEO\Generators\Schema\Breadcrumb;
    } );
    }
    but my theme crashes when I add it to my functions.php

    Hello there,

    I have tried to add this piece of code…
    …but my theme crashes when I add it to my functions.php

    Are you using Storefront as your theme? If not, may I ask if can you temporarily switch your theme to Storefront Does that change anything?

    Another alternative to add the custom code is using a plugin, it is highly recommended to use Code Snippets to add custom PHP code into your site without directly accessing the functions.php file. Here is an article that explains how to use the Code Snippets plugin. Does that make a difference?

    Let us know how it goes.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Conflict Schema.org Breadcrumbs’ is closed to new replies.