How to hide Category from Breadcrumbs

#205460
  • Resolved Vikral
    Rank Math free

    I am having an issue with the breadcrumbs.

    I want My blog’s structure like this, e.g.:
    Home > Blog post title

    But my blog is showing breadcrumbs like this
    Home > Category > Blog post title

    I am using the “Strip Category Base” feature to remove the category from my permalink.
    But somehow, it is not working with my breadcrumbs.

    Actually, I did this previously on some of my sites, but I could not remember how I did.

    How to hide category names from breadcrumbs?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Prabhat
    Rank Math agency

    Hello,

    Thanks for contacting us.

    Please follow the below steps to remove the category from breadcrumbs:

    1. Enable the Hide Taxonomy Name option from your WordPress admin area > Rank Math > General Settings > Breadcrumbs.
      Hide Taxonomy Name Image
    2. Head over to your WordPress admin area > Rank Math > Titles & Meta > Posts, and set the Primary Taxonomy to None.
      Image for Setting Primary Taxonomy to None

    This should remove the category from the breadcrumbs, if you still see the category, then try clearing your website and browser’s cache and see if the issue is fixed.

    Please note that some options are only available when you enable the Advanced Mode in Rank Math. If it’s not showing, you must have chosen to use the Easy Mode. Please follow the steps in this link to switch to Advanced Mode:
    https://rankmath.com/kb/advanced-mode/

    I hope that helps. Thank you, and looking forward to your update.

    Vikral
    Rank Math free

    Thanks, those settings worked. But I found a workaround. I tried this filter, and this filter code also worked.

    /**
     * Allow changing or removing the Breadcrumb items
     *
     * @param array       $crumbs The crumbs array.
     * @param Breadcrumbs $this   Current breadcrumb object.
     */
    add_filter( 'rank_math/frontend/breadcrumb/items', function( $crumbs, $class ) {
            // check if we are viewing single posts
    	if(is_singular('post')){	
    		//Unset elements with key 1
    		unset($crumbs[1]);
                    $crumbs = array_values($crumbs);
    		return $crumbs; 
    	}
    	return $crumbs;
    }, 10, 2);
    Ankit
    Rank Math business

    Hello,

    Glad that helped.

    Do you want us to mark this ticket as resolved?

    and also feel free to reach out to us again in case you need any other assistance.

    We are here to help.

    Thank you.

    Vikral
    Rank Math free

    Hi need help, i did the settings now my breadcrum structure is

    Home >> Post Tite

    I did not wanted like this,

    I need some thing like

    Home >> /permalink

    Because post titles and permalinks are different in my post

    So I need my permalinks in my breadcrums

    Hello,

    Thank you for the follow-up, and apologies for the delay.

    You can change the Breadcrumbs title under the Advanced tab upon editing the post/page. Here’s a screencast for your reference:
    https://i.rankmath.com/iUWSiU

    I hope that helps.

    Thank you, and please don’t hesitate to contact us anytime if you need further assistance with anything else.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 5 replies - 1 through 5 (of 5 total)

The ticket ‘How to hide Category from Breadcrumbs’ is closed to new replies.