Support » Plugin: Yoast SEO » Yoast Remove Custom post name(custom post type) in breadcrumbs

  • Resolved Vino

    (@gvino)


    Hi! I want to remove custom post name in breadcrumbs..

    Custom post type name Products.

    Home » Products » Arthritis » Codeine Phosphate

    Now I want

    Home » Arthritis » Codeine Phosphate

    So, is it possible? What should I do for? Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • You should be able to use the wpseo_breadcrumb_links filter. Assuming your custom post type is ‘product’, in your theme’s functions.php or a plugin, add these lines:

    add_filter('wpseo_breadcrumb_links', 'strip_products_from_breadcrumbs');
    function strip_products_from_breadcrumbs($links) {
         if(is_singular('product')) {
              array_splice($links, 1, 1);
         }
    }

    This tells the plugin that if it is on a single ‘product’ page, it should remove the second item in the breadcrumb trail – Products.

    Hi,

    had the same problem, but the snippet doesn’t work. I’ve only changed the keyword from “product” to the german “Produkte”. The result is, that the whole breadcrumb is gone. And it doesn’t matter if the keyword ist “product” or “Produkte”. We use the Theme Affiliate Theme and in the description they say, it’s optimized for Yoast. So, in my opinion, it should work, but in point of the breadcrumb it doesn’t.

    Could you help me please? 🙂

    Thanks in advance

    • This reply was modified 2 years, 8 months ago by  The-Dude.
    Plugin Support amboutwe

    (@amboutwe)

    @the-dude-1 The code above no longer appears to work. Please try the code here: https://timersys.com/remove-link-yoast-breadcrumbs/

    If you continue to have trouble, please open a new request. That way it’s easier to track issues and provide assistance. Thanks!

    Thank you! That Snippet works 🙂

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Yoast Remove Custom post name(custom post type) in breadcrumbs’ is closed to new replies.