• Hello,

    Im trying to filter out a page link from the breadcrumb trail on a website. I’ve managed to delete it by adding this to the functions.php file:

    function wpseo_remove_home_breadcrumb($links)
    {
    	if ($links[0]['pageurl'] == get_home_url()) { array_shift($links); }
    	return $links;
    }
    add_filter('wpseo_breadcrumb_links', 'wpseo_remove_home_breadcrumb');

    It deletes the link but the separator is still there, resulting in:

    home//page

    Is there a way to also remove the double separator?

    https://www.ads-software.com/plugins/wordpress-seo/

Viewing 4 replies - 1 through 4 (of 4 total)
  • What do you think about this one https://wpbacon.com/tutorials/truncate-wordpress-seo-breadcrumbs/
    I changed the limit value to 0. And deleted the three dots.
    $truncated .= '...';

    Sorry, but I didn’t manage paying much attention to your topic. Sorry, the previous message is a mistake ??

    Just tested this and it worked for me.
    I removed the line get_home_url(), from the function bellow: wordpress-seo/frontend/class-breadcrumbs.php

    /**
    		 * Add Homepage crumb to the crumbs property
    		 */
    		private function add_home_crumb() {
    			$this->add_predefined_crumb(
    				$this->options['breadcrumbs-home'],
    				get_home_url(),
    				true
    			);
    		}
    Thread Starter Coco the dog

    (@yardco)

    Hi alergic,

    Thanks for your replies and my apologies for not replying earlier.

    For some reason my previously posted solution doesn’t work any more and am now stuck with the full breadcrumb trail again. Your solution unfortunately doesn’t work either, it just deactivates the my home url but doesn’t hide it.

    to clarify what im trying to accomplish:

    im using woocommerce and want to eliminate the “products” part in the breadcrumb trail. It now shows:

    home > products > category > category > productname

    I would like to hide or delete the products crumb.

    Your solution unfortunately doesn’t work either, it just deactivates the my home url but doesn’t hide it.

    If you need that, you better also delete breadcrumbs-home, without the two ” symbols.
    Just tested and worked for me.
    I would also check if Google still display the breadcrumbs in search results. That’s why I put back the home breadcrumb. https://www.google.com/webmasters/tools/richsnippets

    Never used woocomerce, but I assume that when you edit a category, WP Seo has also a field for a new category crumb name. Maybe you could try replace with  

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Removing 'page' link separator from breadcrumb trail’ is closed to new replies.