Blog breadcrumbs

#445105
  • Resolved Marilyn Wo
    Rank Math free

    Hi, I am using Elementor Pro. I would like to have my blog post breadcrumb show like this:

    Home / Blog / Design

    Where “Blog” is the page (that is not the homepage) and “Design” is the category.

    But now, my breadcrumbs show like this:

    Home / Design Tutorials /

    Where “Home” is the homepage and “Design Tutorials” is the category of the post.

    My blog individual post URL structure is the default WordPress version now:
    https://meetanders.com/draw-in-illustrator/

    Is it because the URL doesn’t have the word “Blog” that causes the breadcrumbs not to have the word “blog”?

    I’ve already have the category and taxonomy switched on in the RankMath options.

    I would like the word “Blog” to appear in the breadcrumbs, how do I do that without affecting SEO? Thank you 🙂

    Best,
    Marilyn

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hello,

    Thanks for contacting us and sorry for any inconvenience that might have been caused due to that.

    You can use the following filter to add the Blog in the breadcrumbs:

    add_filter( 'rank_math/frontend/breadcrumb/items', function( $crumbs, $class ) {
    	$blog = ['Blog',
    		 'https://rankmath.com' //replace with the URL of the page
    		];
    	array_splice( $crumbs, 1, 0, array($blog) );
    	return $crumbs;
    }, 10, 2);

    Here is how to add a filter to your site: https://rankmath.com/kb/wordpress-hooks-actions-filters/

    Hope this helps. Let us know if you need any other assistance.

    Marilyn Wo
    Rank Math free

    Thanks Jaideep, this works! Next, it is in the correct order if the HOME link is added. But if I switch off the Home link. The blog and category names switched places.

    This is how it looks like with the HOME link, and this is the correct order I want:
    HOME / BLOG / DESIGN TUTORIALS

    This is how it looks like when Home is switched off in the RankMath breadcrumbs settings:

    DESIGN TUTORIALS / BLOG

    Is there something I can do so that it will look like this:
    HOME / BLOG / DESIGN TUTORIALS

    Thank you

    Nigel
    Rank Math business

    Hello,

    We might need to take a closer look at the settings. Please edit the first post on this ticket and include your WordPress & FTP logins in the designated Sensitive Data section.

    Please do take a complete backup of your website before sharing the information with us.
    Sensitive Data Section

    It is completely secure and only our support staff has access to that section. If you want, you can use the below plugin to generate a temporary login URL to your website and share that with us instead:

    https://wordpress.org/plugins/temporary-login-without-password/

    You can use the above plugin in conjunction with the WP Security Audit Log to monitor what changes our staff might make on your website (if any):

    https://wordpress.org/plugins/wp-security-audit-log/

    We really look forward to helping you.

    Marilyn Wo
    Rank Math free

    Hello,

    I have updated the sensitive data as requested. Can you please check further?

    Thank you.

    Nigel
    Rank Math business

    Hello,

    I have modified the code snippet as below to display BLOG / DESIGN TUTORIALS when the homepage link is disabled. The I left the homepage link disabled on your website:

    
    add_filter( 'rank_math/frontend/breadcrumb/items', function( $crumbs, $class ) {
    	$blog = ['Blog',
    		 'https://meetanders.com/blog' //replace with the URL of the page
    		];
    	if (count($crumbs) <3){
    		array_splice( $crumbs, 0, 0, array($blog) );
    		return $crumbs;
    	}
    	array_splice( $crumbs, 1, 0, array($blog) );
    	return $crumbs;
    }, 10, 2);
    

    Hope that helps. Please let us know if you have questions.

    Marilyn Wo
    Rank Math free

    This works fine, thanks Nigel. In the event I would like to have breadcrumbs on other custom pages that are not “Blog” pages, how do I do that if I don’t want “Blog” to appear in those breadcrumbs, but I still want “Blog” in the blog post breadcrumbs? Thank you

    Hello,

    I’ve tried logging in to your website, but it seems that the username is no longer working. Could you please check?

    Meanwhile, please try using this filter instead and let us know if this works with the structure you want to achieve:

    add_filter( 'rank_math/frontend/breadcrumb/items', function( $crumbs, $class ) {
    
    if(!is_singular()){
    $blog = ['Blog',
    'https://meetanders.com/blog' //replace with the URL of the page
    ];
    
    //replace the 'Home' with your Homepage label.
    if($crumbs[0][0] == 'Home'){
    array_splice( $crumbs, 1, 0, array($blog) );
    }
    else{
    array_splice( $crumbs, 0, 0, array($blog) );
    }
    }
    
    return $crumbs;
    }, 10, 2);

    I hope that helps.

    Thank you.

    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 7 replies - 1 through 7 (of 7 total)

The ticket ‘Blog breadcrumbs’ is closed to new replies.