Affiliate Disclosure: I publish various content marketing strategies, online business ideas, blogging tutorials, review articles, and discount offers on my blog. My content may contain some affiliate links for products/services I use, love, and recommend. If you take action (i.e., subscribe or make a purchase) after clicking one of my affiliate links, I’ll earn an affiliate commission at no additional cost to you. It helps me in creating more helpful content like this.

Breadcrumbs play a vital role in allowing users to retrace their navigation path from the homepage to the current page they’re browsing.

Enabling the breadcrumbs has numerous benefits, including better user experience, lower bounce rate, and easier crawling for search engine bots that improve organic ranking.

Adding breadcrumbs to your WordPress website is quite easy. You can enable this feature with a toggle of a button in any popular SEO plugin including Yoast SEO and Rank Math.

However, some people are asking how to enable breadcrumbs with Rank Math SEO plugin.

If you are one who likes the Rank Math and doesn’t want to move back to Yoast or any other WordPress SEO plugin, follow this short tutorial.

How to Enable Breadcrumbs with Rank Math WordPress SEO Plugin

There are a few themes that don’t need an additional setup to enable the breadcrumbs including all MyThemeShop themes.

Other themes require to put a small snippet of code to the functions.php file to display breadcrumbs on the front-end.

Before that, you must enable the Rank Math Breadcrumbs by navigating WP-Admin >> Rank Math >> General Settings >> Breadcrumbs >> Enable breadcrumbs function.

Rank Math BreadcrumbsPin
Rank Math Breadcrumbs

Method 1 – Modifying Functions.php file

You can use this method for enabling rank math breadcrumbs in any WordPress theme. If you’re a complete beginner, make sure to keep a backup copy of your website.

Now, log into your WordPress admin dashboard and follow the path Appearance >> Editor >> functions.php and add the following code at the bottom of the page.

add_filter( 'the_content', function( $content ) {
if( function_exists( 'rank_math_get_breadcrumbs' ) ) {
$content = rank_math_get_breadcrumbs() . $content;
return $content;

Click on the Update File button to save the changes you’ve made in the functions.php file.

Important: If you update/change the WordPress theme, then you may need to reinsert this code to enable the rank math breadcrumbs.

If you want to customize further the appearance for rank math breadcrumbs displayed on your website, you can add the following code under Appearance >> Customize >> Additional CSS and hit Publish button to save the changes.

.rank-math-breadcrumb {
font-size: 18px;
border: 1px solid #00abf0; padding-left: 25px;
padding-top: 15px;
padding-right: 15px;
margin-bottom: 20px;

Method 2 – Adding PHP code through Hooks

This method works only if the WP theme supports an application of Hooks. E.g., GeneratePress Premium.

Once you have activated the breadcrumbs option in Rank Math SEO plugin, simply pick the code snippet provided by MyThemeShop and add to the custom hook of the WordPress template.

If you’re using the GeneratePress Premium WordPress theme, then you need to enable the Elements module under Appearance >> GeneratePress.

In the Elements, Add new Hook by navigating Appearance >> GeneratePress >> Elements >> Add New >> Hook and give a preferred name — Rank Math Breadcrumbs.

Add the following code in the Hook editor.

<?php if (function_exists('rank_math_the_breadcrumbs')) rank_math_the_breadcrumbs(); ?>

Select the following settings and Publish the hook to display SEO breadcrumbs on the page load.


Hook: before_entry_title

Execute PHP: [✓]

Display Rules

Location: Post [All Posts]

Exclude: All Archives

Users: All Users

Method 3 – Adding Shortcode

If you think, the above methods are too complex to understand, then you can use a simple shortcode to display Rank Math breadcrumbs wherever you want. (Don’t forget to remove spaces).

[ rank_math_breadcrumb ]


SEO Breadcrumbs are useful navigation aid for both users, as well as, search engine crawlers. You can enable them using one of the methods mentioned above and see improvements in your organic traffic.

You May Also Like

Rank Math SEO Plugin Review + Best Settings for WordPress SEO

Similar Posts


  1. Jorge Morales says:

    Thank you very much, for your content, it helped me a lot.

  2. Deepak Bhandari says:

    very helpful information about Breadcrumb because this is very important part of any website for SEO point of view ,

  3. Hey Ankit,
    I tried the first method. I’m happy to let you know that it worked for me.

  4. Thanks, Ankit I just added this on my blog using Genesis Simple hooks. It worked great. Thank You!

  5. How to add this in the GeneratePress theme before post/page title?

    1. Ankit Main says:

      You can follow either step #2 or #3. If you’re using GP Premium, then the second method is more convenient.

      1. Davis Perez says:

        Hi Ankit, I was trying to add breadcrumbs before post title, but I couldn’t. I tried this:
        add_filter(‘generate_after_header’, ‘the_content’, function( $content ) {
        if( function_exists( ‘rank_math_get_breadcrumbs’ ) ) {
        $content = rank_math_get_breadcrumbs() . $content;
        return $content;

        1. Ankit Main says:

          Unfortunately, the above code does not work on all themes. That’s why I have enlisted alternate ways to add breadcrumbs. BTW, which theme do you use?
          If you’re using a WordPress theme that uses hooks, (e.g., GeneratePress Premium), then you can use the second method.

  6. Thank you very much for the article, I had problems with this topic and I did not know where to put the Rank Math code, also the css code was very helpful.

  7. Stephen Ekpa says:

    Hi… Thanks for this great tutorial. Just implemented it on my site, and worked like breeze. But I had a little issue while trying to style it using the CSS code snippet you provided.
    I adjusted it to suit my need like this;

    .rank-math-breadcrumb {
    font-size: 16px;
    border: 3px solid #002b5a;
    padding-left: 5px;
    padding-top: 3px;
    padding-right: 5px;
    margin-bottom: 10px;
    Ref. Url: www. droidafrica. net/list-of-infinix-smartphone-to-get-android-90-pie/

    My question is, like in the URL above, how can reduce the border also, to look similar to the top border?

    Thanks for your reply

    1. Stephen Ekpa says:

      Sorry for the typo: I mean how can I reduce the bottom border between the breadcrumb and borderline, to make it have the same space between the top border and breadcrumb?

  8. Thank you this useful post. I love Genesis theme, but bradcrumbs was a little bit odd, You are here 🙂 I used method with modifying functions.php and now looks great. Thank again.

  9. Jose Gary says:

    I can’t copy code because right-click is disabled.

    1. Ankit Main says:

      Hi Jose,
      Sorry for the inconvenience, but we have enabled WP Copy Protection on our website to deal with content piracy. It was severely affecting our SEO efforts.
      However, the code snippet is very short to type, and you won’t mind doing that.
      BTW, thanks for landing by here.

  10. Saurabh Singh says:

    Before a week, I moved from Yoast SEO to Rank Math as I saw many positive reviews from WordPress users.
    But I was unable to add breadcrumbs since I’m not much techy. I started using shortcode at the beginning of each post but it seems time-consuming.
    Your post helped me solve my problem and now I have added breadcrumbs to my site. Thanks.

    1. Ankit Main says:

      Saurabh, glad to see that I could help you.

Leave a Reply

Your email address will not be published. Required fields are marked *