Removing Parent Category from breadcrumbs WordPress SEO by Yoast
-
Hi,
Just a note for anyone looking to remove the parent category from the breadcrumbs (Internal Links) function of the WordPress SEO plugin by Yoast. If you’re not comfortable commenting out code, I wouldn’t suggest doing this.
The context:
I removed them for my blog because my blog title and the parent category name are the same, so I wanted it to go from this:
Home > From The Ground Up (blog landing page link/name) > From The Ground Up (blog parent category link/name) > Child Category > Article Name
to this:
Home > From The Ground Up (blog landing page link/name) > Child Category > Article NameThe code to edit:
First, I enabled breadcrumbs.
Then I commented out 2 areas in the plugins/wordpress-seo/frontend/class-breadcrumbs.php file in version 1.5.3.3 of the plugin:
Line 483: I commented out the if statement that beginsif ( is_taxonomy_hierarchical( $main_tax ) &&
Line 516: commented out$this->maybe_add_preferred_term_parent_crumb( $term );
Line 518 : commented out$this->maybe_add_term_parent_crumbs( $term );
FYI:
To be able to view your blog home page link in the breadcrumbs when on a tag page, I did not check the checkbox that says “Remove blog page from breadcrumbs” in the Breadcrumbs Settings. Checking this will make it so only the home page (site home page if different from blog home page) and tag to show as
Home > tag name
versus
Home > From the Ground Up (blog title link/name) > tag nameHope this proves useful to others.
https://www.ads-software.com/plugins/wordpress-seo/
- The topic ‘Removing Parent Category from breadcrumbs WordPress SEO by Yoast’ is closed to new replies.