- 1 How to implement schema markup
- 1.1 1. Generate the markup
- 1.2 2. Test your code first
- 1.3 3. Deploy the code on your website
- 2 How to monitor your schema markup
Many SEOs find schema markup daunting because it’s so code-heavy, but there’s no need to be afraid. It’s relatively easy to understand once you grasp the basics.
So let’s explore how to implement schema markup on your site:
- Generate the markup
- Test your code first
- Deploy the code on your website
1. Generate the markup
It’s entirely possible to write schema markup yourself, but often, there’s no need. If you’re using WordPress, there are plenty of plugins that make life easy. If not, there are countless markup generators. I like the one from Merkle and the Schema Builder extension, but there are many options. Keep in mind that these generators usually only cover basic markup. To go beyond that, you’ll have to adjust the code yourself.
All code examples here use the JSON-LD format, which is recommended by Google. It’s also the easiest to understand and deploy.
However, you will still frequently encounter another format called Microdata because CMS’ and their plugins often use it. The only other acceptable format is RDFa as an extension to HTML5, but I’ve never seen that in action.
2. Test your code first
Unless you’re using a CMS or plugin where you interact via a UI, you should always test your markup before pushing it to production.
For this, Google has developed two easy-to-use testing tools.
There’s a general structured data testing tool. This is still usable at the time of writing (August 2020), but it will be deprecated in the future.
The new standard is the rich results test tool. As the name suggests, it focuses on rich results, which leaves out the vast majority of the schema.org vocabulary. If you’re testing a code snippet or a page without markup that triggers rich snippets, it won’t show you the schema tree as the former does:
The rich results test tool also doesn’t show errors if you misuse schema types or properties:
For these reasons, I recommend validating your markup in both tools while you still can.
3. Deploy the code on your website
This step will differ depending on your website and tagging system. As I already mentioned, we’re talking JSON-LD here as the recommended schema format.
We’ll go through these three implementation methods:
- Straight into the HTML
- Using Google Tag Manager
- Using a CMS and plugins
Straight into the HTML
JSON-LD schema is formatted as a script that’s placed into the
<body> of your HTML.
If you’re not the webmaster, talk to your developers and agree on how to assign this task to them. This will likely include mapping URLs or their categories to different schemas and highlighting static and dynamic values (think brand vs. price for product schema).
Using Google Tag Manager
This is especially good for marketers who are comfortable working with GTM. It’s an excellent workaround for companies where it takes a long time to get SEO changes implemented by the development team.
I can only recommend this method if you’re already using GTM to manage your marketing technology stack. Just paste the created schema as a custom HTML tag and set up the trigger based on a page view to a specific page or pages.
Using a CMS and plugins
This is the most common and beginner-friendly way to deploy schema markup. But due to the number of different CMS and plugins, it can also be the most confusing one.
There’s no CMS or plugin that does all the work for you. If you require a more advanced schema markup, you’ll inevitably have to combine the available options. That can also involve adjusting your themes and templates, or injecting the code on a page directly or via GTM.
Let’s look at how to implement common schema types using a few popular WordPress SEO plugins.
You should only use one all-in-one SEO plugin like Yoast, RankMath, or The SEO Framework. Using two or more will likely cause issues. If your plugin doesn’t suit all your schema needs, use a dedicated schema plugin on top of that.
1. Organization schema with Yoast
In the Search Appearance settings under the General tab, filling in the following:
Then provide links to your social and company profiles in the social settings:
That’s it. You’re done. Your organization will now appear as a publisher of your articles, or as another property depending on the page type.
2. Product schema with Rank Math
Rank Math seems to offer the most schema options out of all the well-known free SEO plugins. You can set up basic schema markup like Organization and Person in the plugin settings. But if we go beyond that, it also lets you add schema to specific pages.
Just head to a page or post, click the plugin button, choose your schema type and fill in the information.
Here’s an example of adding product schema to a page:
3. VideoObject schema with Schema & Structured Data for WP & AMP
This is one of those dedicated schema plugins. For some types of schema, it can even fetch data from your page automatically and populate some of the boxes.
Here’s what happens when I embed a YouTube video into a WordPress page with the plugin activated:
And if you check the tabs on the left, there’s an option to paste custom JSON-LD schema into the page.
But what about other CMS’? Well, the options are more limited.
Shopify supports schema markup with some out of the box themes and apps like SEO Manager or JSON-LD for SEO. Squarespace can populate some very basic markup from your settings. And Wix straight up relies on you pasting the code there:
As you can see, there’s no one-fits-all solution here. It depends on your requirements, your CMS, and your technical limitations.
Now the implementation is out of the way, let’s talk about monitoring.
Google Search Console shows all detected markup types under the Enhancements tab:
Click on a specific schema type to see the report:
If you validated the markup before implementing, you shouldn’t run into problems here. It’s also worth noting that there are required properties for some schema types that may trigger errors if missing. These are often negligible, so don’t worry about them too much or prioritize fixes.