How to Add Breadcrumbs Schema without a plugin

Manuel Campos

In WordPress, breadcrumbs are a type of navigation element that helps users understand the structure of your website and their current location within it.

They are usually displayed as a series of links at the top of a page, separated by a delimiter such as a “>” symbol.

For example, if you have a website with a structure like “Home > Blog > Category > Post,” the breadcrumb trail for a particular post might look like this:

Home > Blog > Category > Post

Breadcrumbs provide a useful way for users to quickly navigate back to a higher level in the website hierarchy, and can also help search engines to understand the structure of your website and its content.

These are some code snippets to generate breadcrumbs and breadcrumbs schema without a SEO plugin.



Why Not Use a SEO Plugin?

There are situations in which you probably want to code a simple plugin and not use a SEO plugin.

  • If you are like me, you only want to use plugins whose features are so complex to be replaced by simple code snippets.
  • You are sick and tired of SEO plugins that have a bunch of features you don’t really need.
  • You probably have a plugin but you are required to pay for a premium subscription if you need to add breadcrumbs and breadcrumb schema to your site.

Let’s take SEOPress as an example, if you need breadcrumbs or breadcrumbs schema, you need to pay $49 a year for that feature and other features you might or might not need.


Code to Generate Breadcrumbs Schema

I use the mu-plugins folder to add code snippets to my site

This is my mu-plugin to create breadcrumbs

This won’t add the breadcrumbs to your post and pages automatically, you need to add them to your hero section using a shortcode

Since I use GeneratePress and GenerateBlocks, I usually add the code to my hero section for all posts and pages


Breadcrumbs Schema without a Plugin

This is my mu-plugin to generate the breadcrumbs schema

I have tested the schema generated by the plugin using schema validators and the code generated pass the tests by those tools


Manuel Campos, English Professor

Manuel Campos

I am José Manuel. I am writing about things I know and things that I am learning about WordPress. I hope you find the content of this blog useful.

WP SURFER

home

about

privacy

contact

© 2024 WP SURFER • Made with Love in Costa Rica