Hello,
Thank you for contacting Rank Math support. We’re sorry for any trouble or confusion.
We would like to check your website and see what’s causing the issue with the breadcrumbs. To do that, we need some information from you.
Please share your website URL with us so we can visit your site and inspect the breadcrumbs. Please also share the code that you used to add the breadcrumbs and tell us where you added it. You can use the Sensitive Data section below to share this information privately.
This will help us understand your situation better and provide you with a solution.
Thank you for your cooperation and patience. We look forward to hearing from you.
Hello,
I have updated the sensitive data as requested. Can you please check further?
Thank you.
Hi Great,
I updated the sensitive data form.
I added the code on Appearance > Elements > Hook
This is what GeneratePress instructed me to do instead of the Single Template that RankMath showed. I tried that too, but it was not saving, showing error instead.
This is the cod:
<?php if (function_exists(‘rank_math_the_breadcrumbs’)) rank_math_the_breadcrumbs(); ?><span>I am a test</span>
I also tried the shortcode, but still didn’t work.
Thank you!
Mary
Hello,
Please try adding the following PHP snippet in order to display breadcrumbs in Generatepress.
add_action( 'generate_after_header', function() {
if ( function_exists('rank_math_the_breadcrumbs') ) {
rank_math_the_breadcrumbs( '<div class="grid-container grid-parent"><p id="breadcrumbs">','</p></div>' );
}
} );
Here’s a guide on how you can add PHP Snippets to your WordPress site:
https://docs.generatepress.com/article/adding-php/
Hope that helps, and please do not hesitate to let us know if you need our assistance with anything else.
Thank you.
Hi Sakib,
Thanks for the reply. But that’s an old way of editing PHP in GeneratePress. They now use “Hooks” under Appearance.
On the hook section, I added the <?php if (function_exists(‘rank_math_the_breadcrumbs’)) rank_math_the_breadcrumbs(); ?>. I also tried [rank_math_breadcrumb]. But neither is working. I’ve already asked GP for help here, and they have tested that the hook is working. But for some reason, the RankMath code is not working.
You can see the “Updated” text under the content title of any post, that is added by Hook.
Hi,
I found the answer, it looks like I had to tick “execute PHP” on hook settings by GeneratePress. That was not shown in GP guide and their support didn’t mention that.
So, now the breadcrumbs is working. However, it’s not showing the category even though I enabled “show category” in Breadcrumbs setting. It’s showing as Home >> Post Title.
Under “links” tab, I had “strip category base” enabled. Is that the reason? I don’t want a category on the permalinks, but I want it to show on the breadcrumbs.
Thank you so much!
M
Hello,
Thank you for the update.
We’re glad that you have already been able to make the breadcrumbs work on your site.
To show the category on the breadcrumbs, ensure that you have already selected the categories as your primary taxonomy.
Head over to Rank Math > Titles & Meta > [Post type] and select Categories in the Primary Taxonomy option

Hope that helps.
Thank you.
Thank you so much, Reinelle! That solved it! Enjoy your day!
Hello,
Glad that helped.
Please feel free to reach out to us again in case you need any other assistance.
We are here to help.
Thank you.