WordPress.org

Forums

Yoast SEO
How to remove Products link - Shop (1 post)

  1. jumust
    Member
    Posted 1 year ago #

    Hi,
    I'd like to remove the parent link "Products" (linked to shop page) in the breadcrumbs of product pages.

    Now I have "Home-->Products-->Product Category-->Product name

    I have tried this snippet in my functions.php file

    add_filter( 'wpseo_breadcrumb_links', 'custom_wpseo_breadcrumb_links' );
    
    function custom_wpseo_breadcrumb_links( $links ){
        if( is_product() ){
           // print_r( $links );
            unset( $links[1] );  // unset the second array item (starts from 0, 1, 2, ... )
        }
     return $links;
    }

    It worked, basically the Products link disappeared. But I don't know why now the Product Category link is not linked anymore. In the source code I see it got class="breadcrumb_last".

    How can I fix it?

    Thanks

    http://wordpress.org/plugins/wordpress-seo/

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Yoast SEO
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic