Breadcrumbs not working correctly on posts page.

#786388
  • Resolved Anonymous
    Rank Math free

    My articles are structured Home » Articles » Article

    I’ve added the correct hierarchy within wordpress but the breadcrumbs only display like Home » Article

    Is there anyway to add custom breadcrumbs to the posts page so it is correct for all posts?

Viewing 1 replies (of 1 total)
  • Hello,

    I apologize for the issue you are facing with the breadcrumbs on your posts page. To customize the breadcrumbs on your posts page to display the correct hierarchy like Home » Articles » Article, you can use a custom code snippet.

    You can add the following filter to your site to include a ‘Blog’ page in the breadcrumbs and adjust the hierarchy accordingly:

    
    /**
     * Filter to add a 'Blog' page to Rank Math Breadcrumbs.
     */
    add_filter( 'rank_math/frontend/breadcrumb/items', function( $crumbs, $class ) {
    
        if ( is_home() || is_front_page() ) {
            return $crumbs;
        }
    
        $blog = ['Blog',
             'https://yourdomain.com/blog' //replace with the URL of your blog page
            ];
        if (count($crumbs) 

    Sources:
    How to Customize Breadcrumbs in Rank Math » Rank Math
    How to Enable Breadcrumbs on Your Website With Rank Math SEO » Rank Math

    This is an automated reply from Rank Math Support Bot. If you need further assistance, please reply to this topic and a human support agent will reply to you shortly.

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

The ticket ‘Breadcrumbs not working correctly on posts page.’ is closed to new replies.