• Resolved seotic

    (@seotic)


    Hi everyone, I’m having troubles with the breadcrumb of my website.

    I have only one product category and I would like to have a breadcrumb like “Shop/Product-name” instead of what I currently have: Shop/Product-Category/.

    The issue here is that the shop page and the product category page are duplicated, they both contains the list of all products, which is not ok for SEO.

    I don’t want to redirect one of the page to another one.

    For the moment, those stuffs are on private mode, so not yet published.

    I’m using the Flatsome theme: https://themeforest.net/item/flatsome-multipurpose-responsive-woocommerce-theme/5484319

    Thanks in advance for helping me to solve the issue.

    Kind regards,

    Bader

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Support Niall a11n

    (@wpniall)

    Hi Bader (seotic) ?? Thank you for reaching out to us. I’m happy to help you with this breadcrumbs issue!

    It sounds like the product category has the shop page have the same name and content as each other, which would appear as duplicated content in search engines and not be good for SEO. So you’d like to change the structure from Shop/Product-Category/ to “Shop/Product-name.”

    To clarify a bit further, I understand you need this:

    1. The shop page at /shop/.
    2. Products should list as /shop/product-name rather than /shop/product-category/product-name.

    Am I understanding that correctly?

    Thread Starter seotic

    (@seotic)

    Hi, thank you for your reply. Indeed you are right, I need to have the product page with Breadcrumb /shop/product-name and no category anymore since I only have one product category.

    Thread Starter seotic

    (@seotic)

    Hi there, is there someone who can help to fix my issue ?

    Kr,

    Bader

    Plugin Support Beauty of Code (woo-hc)

    (@beautyofcode)

    Hey Bader,

    Thanks for clarifying!

    If the Flatsome theme does not have a built-in setting to change the breadcrumb, you can modify this with custom code.

    While custom code is outside our scope of support, I found a code snippet on Stackoverflow that can help you achieve this. Can you try adding the following code snippet and see if this does the trick:

    // change the breadcrumb on the product page
    add_filter( 'woocommerce_get_breadcrumb', 'custom_breadcrumb', 20, 2 );
    function custom_breadcrumb( $crumbs, $breadcrumb ) {
    
        // only on the single product page
        if ( ! is_product() ) {
            return $crumbs;
        }
        
        // gets the first element of the array "$crumbs"
        $new_crumbs[] = reset( $crumbs );
        // gets the last element of the array "$crumbs"
        $new_crumbs[] = end( $crumbs );
    
        return $new_crumbs;
    
    }

    Stackoverflow snippet link

    The code snippet seems to be working as expected on my test site which uses the default Storefront theme. Here are the results.

    Before:

    After:

    I’d strongly suggest using a plugin that allows custom functions to be added to your site, such as the free?Code Snippets?plugin, rather than adding any code directly to your?functions.php?file.

    Note: We always suggest ensuring that you have a good backup of your full site and database in place before applying any custom code to your site, so that, should something go wrong, you are able to easily restore your site to a functioning state.

    Cheers!

    Thread Starter seotic

    (@seotic)

    Hi Roxy, you rock !!

    Thank you very much for your answer, it seems to work but I think I forgot to mention that I should have the home page as first element, so it would be something like Home/Shop/ instread of just /Shop/

    I’ve put the snippet in the functions.php of the child theme and already have a backup.

    Thanks again for your help.

    Kr,

    Bader

    Hi @seotic,

    Thank you very much for your answer, it seems to work but I think I forgot to mention that I should have the home page as first element, so it would be something like Home/Shop/ instread of just /Shop/

    Thank you for your response and the kind words! I’m glad to hear that the code snippet is working for you.

    With regards to your request to have the Home page as the first element in the breadcrumb, the code should already include this by default. The ‘Home’ link should be automatically included in the breadcrumb as the first element, so your breadcrumb should look like this: Home/Shop.

    Here’s an image for your reference:

    Image Link: https://snipboard.io/8HbcPq.jpg

    If you’re not seeing this, it’s possible that there might be some other theme or plugin settings that are interfering with the default breadcrumb structure.

    If the issue persists, could you please provide a screenshot of what you’re seeing on your end? This will help us better understand the issue and provide a more accurate solution. You can share screenshots at https://snipboard.io. Just follow the instructions on the page and paste the URL in your response.

    Also, remember to clear your cache after making changes, as sometimes, old versions of your pages might be displayed.

    Looking forward to your response!

    Thread Starter seotic

    (@seotic)

    Hi, I’ve pasted the screenshots?like suggested:

    It’s a website under construction but I think that you will have enough informations with the screenshots?sent.

    Thanks in advance.

    Kind regards

    Bader

    Thread Starter seotic

    (@seotic)

    Hi, one thing that I can mention is that I made a test by deactivating all the extensions except woocommerce and I still get the issue.

    I only have the default themes of WordPress, Flatsome Theme and the Flatsome child theme.

    Maybe this could help

    Kr,

    Bader

    Thread Starter seotic

    (@seotic)

    Hi, I found how to fix it finally, I forgot to check the option to add the home page in the breadcrumb, then I just looked for the name of the category I wanted to remove. This is temporary fix until I sell a second product category.

    Thanks all for your help !

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Breadcrumb for one product category’ is closed to new replies.