• Resolved woomad

    (@woomad)


    Is there any way I can remove the post title just like above and also remove the All products text which is linking to shop now.

    Right now mine looks like this
    Home>All products > category1>category2>item

    However, I want it to look like this

    eg: Home> category1 > category 2

    It worked before with the older yoast versions with the following code

    /*
    * Remove a link from the Yoast SEO breadcrumbs
    * Credit: https://timersys.com/remove-link-yoast-breadcrumbs/
    * Last Tested: Mar 12 2017 using Yoast SEO 4.4 on WordPress 4.7.3
    */

    add_filter( ‘wpseo_breadcrumb_single_link’ ,’wpseo_remove_breadcrumb_link’, 10 ,2);

    function wpseo_remove_breadcrumb_link( $link_output , $link ){
    $text_to_remove = ‘Products’;

    if( $link[‘text’] == $text_to_remove ) {
    $link_output = ”;
    }

    return $link_output;
    }

    But now it stopped working even when I tried to change the text to All products from products.

    Thanks

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi @woomad,

    Thank you for reaching out!

    The All Products link is most likely included because it’s part of your permalink structure for products configured under Settings → Permalinks → Product permalinks (at the bottom). When the shop base is included in the structure, it is also included in the breadcrumb structure.

    To remove the last part, the product title, please check the code here. Please note that we can’t give support on customizing our plugin on your site as all sites differ. We recommend testing this on a staging environment of your site.

    Thread Starter woomad

    (@woomad)

    Hi @jeroenrotty

    Thank you for your reply.

    My permalinks are set up as a custom one like this

    /product/

    and it was always like this.

    I have the same setup on my live site and is running yoast Version 12.7.1 and the above code I mentioned works fine and takes off the products text in breadcrumbs with the link to shop page fine.

    However, with the 14.2 on my staging site I noticed that the text in breadcrumbs is changed to all products and still link to shop page. Which is strange? as nothing else has changed. I modified the above code to all products instead of products to test. But it hasn’t worked either.

    Thanks

    Plugin Support devnihil

    (@devnihil)

    @woomad Can you confirm you are using WordPress 5.4.1? You can check by clicking on the W in the top left and selecting About. If you need to update, please check with your host provider. Please know that if you are using an older version of WordPress Core you may experience unexpected behavior with Yoast. This guide explains more: https://yoast.com/why-we-dont-support-old-wordpress-versions/
    ?
    ?If you update to the most current version of WordPress, does this resolve the issue?

    If the issue is still occurring after confirming both Yoast SEO and WordPress are updated, this may be due to a plugin or theme conflict. Can you try and gather as much information for us as possible? Please perform the following:

    1. Check for conflicts.
    2. Check for JavaScript errors with your console.
    If you find any JavaScript errors related to Yoast SEO or if there is a conflict with a plugin or a theme, you can create a new GitHub issue for our developers. Please report the issue to a third party developer as well.

    Thread Starter woomad

    (@woomad)

    Hi @devnihil Thank you for your feed back. I am running the latest wordpress. In fact all my plugins are up to date. I have also tried it with storefront theme as well just to rule out my current theme. I have also checked for conflicts and errors. What is interesting is that when I view the page source the shop link isn’t there on the bread crumbs source code and it is only visible on the page.

    I have tried the following code to eliminate the last one title on the bread crumb, so it works

    /*
    * Remove the last breadcrumb, the post title, from the Yoast SEO breadcrumbs
    * Previous breadcrumb will remain linked
    * Credit: David @ https://generatepress.com/forums/topic/how-to-hide-the-title-part-in-the-breadcrumb-im-using-yoast-seo/#post-614239
    * Last Tested: Apr 11 2020 using Yoast SEO 13.4.1 on WordPress 5.4
    */

    add_filter(‘wpseo_breadcrumb_single_link’, ‘remove_breadcrumb_title’ );
    function remove_breadcrumb_title( $link_output) {
    if(strpos( $link_output, ‘breadcrumb_last’ ) !== false ) {
    $link_output = ”;
    }
    return $link_output;
    }

    As I said before this only started happening after the ver 14 update and not before

    Thanks

    Plugin Support Md Mazedul Islam Khan

    (@mazedulislamkhan)

    While we are unable to confirm whether this is a bug specific to Yoast SEO or specific to your setup, we’d recommend you to submit an issue report directly into our development repository so our development team look into this further for you.

    Plugin Support Jerlyn

    (@jerparx)

    Hi @woomad ,

    We’re closing this thread because we haven’t heard back from you in a while. Should you have further questions, please open a new thread.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How to remove All products link and the product name in yoast breadcrumbs’ is closed to new replies.