How To Add Breadcrumbs To GeneratePress With Yoast SEO: Complete Guide

Breadcrumbs are awesome because not only do they make your website more usable for humans, but they can also help enhance how your website looks in the Google search results.

example of breadcrumbs in SERPS

But unfortunately, as flexible as GeneratePress is, GeneratePress doesn’t allow you to turn on breadcrumbs in the WordPress Customizer (though I’ve seen Tom mention that he might add this).

Having just moved this website to GeneratePress, I wanted a way to display breadcrumbs on my single posts like my previous theme allowed.

As you can see from the breadcrumbs on this post – I found a way to make it work! Here’s the end result again:

example of GeneratePress breadcrumbs on my site

Now I’ll share the process. The way I did this only adds breadcrumbs to individual blog post pages. But I’ll also share an alternate snippet that you can use to add breadcrumbs everywhere.

Also, you’ll need Yoast SEO to make this work. I went that route because I was already using Yoast SEO so I didn’t want to install a new plugin.

Here’s how to add breadcrumbs to GeneratePress with Yoast SEO.

How To Add Breadcrumbs To GeneratePress: What You Need

To follow this tutorial, you’re going to need two things:

  • Yoast SEO – the free version is totally fine.
  • GeneratePress Premium – you need access to the GeneratePress Hooks add-on to follow this exact process, though you could probably edit a child theme directly if you don’t want to pay. I think GeneratePress Pro offers amazing value in a lot of ways, though, so just go ahead and buy it already.

Step 1: Enable Breadcrumbs In Yoast SEO

Assuming you’ve got Yoast SEO already installed and activated, you’ll need to enable the Advanced Settings pages before you can access the breadcrumbs feature. To do that, click on SEO in your WordPress dashboard to access the Yoast SEO dashboard.

Then, click on the features tab and make sure Advanced settings pages is Enabled:

yoast seo advanced settings pages

Once you save the changes to enable those pages, you’ll get a bunch of new options under the SEO menu in your WordPress dashboard sidebar.

Click on Advanced. Then, hit the toggle to Enable Breadcrumbs:

yoast seo breadcrumbs feature

Step 2: Configure Breadcrumbs In Yoast SEO

Once you Enable breadcrumbs, you should see a bunch of new options.

I leave most of these as the defaults.

The only thing that I configured is the Taxonomy to show in breadcrumbs for post types. I recommend choosing Category, but you can pick tags if you want, too:

pick a category

This helps add some extra context to your breadcrumbs. Here’s an example of where it shows up:

example of category

Step 3: Add Yoast SEO Breadcrumbs PHP Function To GeneratePress Hooks

Now, go to Appearance → GP Hooks to access the GeneratePress hooks.

If you don’t see this, you might need to activate it by going to Appearance → GeneratePress:

activate generatepress hooks

Once you’re in the GP Hooks area, find the box for Before Content and paste in this code snippet. Some people also like the Inside Content Container hook. You can play around to see which one you like. Also, make sure to check the box for Execute PHP:

<?php if ( is_single() && 'post' == get_post_type() ) : ?>
<?php if ( function_exists('yoast_breadcrumb') ) { ?>
 <?php yoast_breadcrumb('<p id="breadcrumbs">','</p>'); ?>
 
<?php } ?>
<?php endif; ?>

place yoast seo breadcrumb php code

Now, click the Save Hooks button on the right-side of the screen and your breadcrumbs should be active on your GeneratePress site.

This code snippet just adds breadcrumbs to single posts.

If you want to add breadcrumbs to every single piece of content on your site, remove the if (is_single) part like this:

<?php if ( function_exists('yoast_breadcrumb') ) { ?>
 <?php yoast_breadcrumb('<p id="breadcrumbs">','</p>'); ?>
 
<?php } ?>

This will put breadcrumbs everywhere, though. I think it’s kind of ugly and doesn’t help usability as much, which is why I opted to only put them on single posts.

Any other questions about how to add breadcrumbs to your blog posts on GeneratePress? Leave a comment and I’ll try to help out!

10 thoughts on “How To Add Breadcrumbs To GeneratePress With Yoast SEO: Complete Guide”

  1. Hi Collin,

    That codes are work perfectly on my blog. But i have some question.

    Default breadcrum is something like: Home >> Post Titile.

    Is it possible to have Custom Link Pages for “Home”. I want to change with another Pages. (Pages >> Post Title)

    Thanks.

    Reply
  2. Thanks a lot!. It helped.

    A heads-up ; Looks like Yoast made changes to their interface. The “Dashboard” tab is no longer there. I was able to access breadcrumbs through the “Search Appearance” Tab.

    Reply

Leave a Comment