Breadcrumbs not working correctly on posts page.

#786388
  • 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.

Viewing 1 replies (of 1 total)

You must be logged in to reply to this ticket.