How to Enable Breadcrumbs with Rank Math WordPress SEO Plugin

How to Enable Breadcrumbs with Rank Math WordPress SEO Plugin
How to Enable Breadcrumbs with Rank Math WordPress SEO Plugin

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 results in an improvement in 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, then 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 Breadcrumbs – General Settings

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 – The Stormbreaker to Win SEO Infinity War