• Resolved scprojects.gr

    (@scprojectsgr)


    Hi,

    I am looking for a solution to remove the /shop/ page from the bradcrumbs that yoast exports.

    Do you have any solution so I can remove the shop page from the breadcrumbs and leave only Homepage > Category > Child category > product ?

    i have use this

    add_filter(‘wpseo_breadcrumb_single_link’ ,’remove_shop’, 10 ,2);
    function remove_shop($link_output, $link ){
    if( $link[‘text’] == ‘Products’ ) {
    $link_output = ”;
    }
    return $link_output;
    }

    But it does not working

    Whatever i try, yoast always puts shop between homepage and first category

    Thank you

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

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter scprojects.gr

    (@scprojectsgr)

    I fix it you can close the Topic

    Hi! I have same problem.
    How did you solve the problem?
    Can you share the code?

    Thread Starter scprojects.gr

    (@scprojectsgr)

    add_filter(‘wpseo_breadcrumb_single_link’ ,’remove_shop’, 10 ,2);
    function remove_shop($link_output, $link ){
    if( $link[‘text’] == ‘Products’ ) {
    $link_output = ”;
    }
    return $link_output;
    }

    And you change the “Products” to that you have. “shop”, “Home” whatever.
    you know where to put the code?

    Hi @scprojectsgr!
    Thank you!
    I inserted you code, its worked.
    After i updated wordpress, woocommerce, yoast and now its no working.
    the Shop is shown in breadcrumbs.
    I have child theme Astra. added code in function.php

    add_filter('woocommerce_get_breadcrumb', 'remove_shop_crumb', 20, 2);
    function remove_shop_crumb($crumbs, $breadcrumb)
    {
        $new_crumbs = array();
        foreach ($crumbs as $key => $crumb) {
            if ($crumb[0] !== __('Shop', 'Woocommerce')) {
                $new_crumbs[] = $crumb;
            }
        }
        return $new_crumbs;
    }
    

    This code working

    Thread Starter scprojects.gr

    (@scprojectsgr)

    you must paste the code to your child theme in order to do not have problems when updates are made.

    The question is not where I insert the code.
    “I have child theme Astra. Added the code in function.php”
    Now its work with new code.
    But now I have the same problem in schema.
    On the site is site/category
    In schema is site/shop/category
    I need to find code which will move shop from schema.

    Thread Starter scprojects.gr

    (@scprojectsgr)

    Both of 2 codes are doing the same thing. No need to find something else. Check schema to find what “shop” word – string you must add to the code to make it work.

    I talk about this think:
    https://validator.schema.org/
    on my website breadcrumbs is: site/category
    in schema org validator is: site/shop/category
    and google see is like in schema!
    its not good for seo

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Remove the /shop/ page from a woocommerce product breadcrumbs’ is closed to new replies.