Add Custom Breadcrumb with Post Tags in WordPress Blog

Breadcrumb list is a good choice to give the reader a better navigation experience. Users can easily reach at your different content pages through a bit different taste. But it is wondering that most of the popular WordPress theme neglected this part. The matter of fact is that the breadcrumbs are not only for the navigation purpose but also matter at your SEO performance in Google SERPs. According to the guide for Google Search Engine Optimization, they always recommend to use breadcrumbs.

Ensure more convenience for users by using ‘breadcrumb lists’

A breadcrumb is a row of internal links at the top or bottom of the
page that allows visitors to quickly navigate back to a previous
section or the root page (1). Many breadcrumbs have the most
general page (usually the root page) as the first, left-most link and list
the more specific sections out to the right.

[Source]

While adding breadcrumbs in blogs or websites is a good practice for SEO, it should also ensure that you have applied them properly so that the Google bots can recognize them. Google has released some rules for adding breadcrumbs in website or blog. Read the Google webmaster guide for breadcrumbs.

You can read there that adding breadcrumbs simply in your website will not make any sense for the bots. The breadcrumbs must contain some properties which can be labelled by microdata or RDFa markup. Once you apply the rules for adding breadcrumbs in you site following the Google guidelines, the breadcrumb list will appear at the search results instead of the page url.

Now the question is that how to add breadcrumbs at WordPress blog in a proper way? To be frank, I was also into the dark on this issue. But when I came to know about the advantage of using breadcrumb, I tried to apply it in this blog using the post tags. I have tried various WordPress plugins which offer this feature but none of them was actually what I need. Later, I decided to make my own custom code for applying breadcrumbs with the post tags on my blog.

Here is a complete guide on the implementation of breadcrumbs in WordPress blog using custom code.

1. Open your theme’s function.php file with WordPress theme editor or simply download that using FTP.

2. Add the following code after the last line of the function.php file.

Copy the text version of the code from here.

3. Save the changes or/and upload the file at the right place through FTP.

4. Add the following code at the theme template where you want to show the breadcrumb list. In my case, I only allow the singe posts to be indexed by Google. Therefore, I placed this code at single.php. You can add this code anywhere in your site though.

Copy the text version of the code from here.

Note: Replace “www.yoursite.com” with your own home page URL.

You are done! Save the template and open your site. You should see the post tags are arranged like this:

Once completed, you can check the preview of your pages at Google search results using the rich snippets testing tool.

Why should I use tags in breadcrumb?

Well! Tags are very related with keywords of the post content. Therefore, showing the terms related to the keywords will promote the page in the Search Engine ranking.

References:

Function Reference/get the term list

Function Reference/get the tag list

Update: After publishing this post, many readers have successfully applied the Google friendly breadcrumbs for their blog. But, those who use Thesis theme have complained that this code is not working in their blog. There is nothing bad with this code for custom breadcrumbs with post tags in WordPress blogs but the Thesis theme users should imply this cleverly into their theme template. Here is how to do that.

Adding custom breadcrumbs with Post tags in WordPress with Thesis

At first, login to your WordPress dashboard and add the following code at the custom_functions.php using the theme editor.

Copy the code for Thesis theme from here.

Let me know if you face any problem when applying this code at your Thesis theme.

Comments

  1. I added the codes as per the post in functions.php and single.php but no breadcrumbs were showing. Am i missing something?

  2. Tanmay

    @Shabnam Sultan: Sorry for my mistake. Their was a mistake with the code. I have rectified that and working fine now. Please repeat the procedure with these new codes and you should get the results. Further question is always welcome.

  3. Thanks Tanmay the codes are working fine on my thesis blog.

  4. Worked, just waiting for the results in goolge. Thanks

  5. Tanmay

    @Adam Beaumont: Also let me know when you get the result.

  6. Imran Soudagar

    Thanks for the useful information. And also for the code I can now add it to my site and experiment.

  7. Gaurav

    Want to know how to show author image in google search
    Saw that your articles have your image in google
    Please tell me how you do it?

  8. Tanmay

    @Gaurav: Yes, this can be easily done by some procedure. We shall come with an article about that. Stay tuned with us.

  9. Yes i heard about it.But cant able to set this. Anyone who can do this for my web site from TV(Team Viewer) ?
    Advance thanks.

  10. Thanks for the codes Tanmay.. I using Thesis theme too… ;)

  11. I already have a separate breadcrumb.php on my theme, but I will have to try putting instead on my header.php i will have to call breadcrumb on my single.php and see what happens. Thanks for the tip.

  12. Never knew that adding breadcrump feature is such a simple thing… Thanks for the codes..

  13. Vikas Sindher

    Thank you Tanmay sir. I have found many scripts out there but i never knew what breadcrumbs actually are.They are surely very powerful. Thanks for the code.

  14. Hey that is really a very nice tut. Can you teach how to add breadcrumbs in results of a blogger blog?

Speak Your Mind

*