Cover photo for this article showing Google's landing page for web searches.SEO

How To Add Structured Data To WordPress Websites

When you purchase an item through coupons or links on our site, we may earn an affiliate commission.

A handy guide on how to add structured data markup in a WordPress website without a plugin. Also works for schema markup in other websites.

If you are looking to improve your SEO performance (click-through rates) of the posts and pages you publish, it is important to add structured data and schema markup to your website. Most of us who are not good at coding don’t know how to add structured data to our websites and have our search results show up with enhancements in Google searches such as rich snippets. As a result we miss out on an easy way to improve our search engine optimization (SEO) performance in Google search results.

In this guide you will learn how to add structured data to your WordPress website without using a plugin. Generating your own customized structured data is quick and easy. We will show you how. The only plugin needed is one that will add our structured data code to the head section of the post or page.

How Does Structured Data Improve Your SEO Performance

Rich snippets or rich results are additional information that show up next to you URL when it appears on a Google search result page. For example, lets say you have reviewed a product. If you add structured data, you can get a visual of your rating on a star scale below the search result. This attracts people’s attention to your review, increasing your click-through rates and improving your SEO performance.

Another advantage of taking the time to add structured data to your website is that it helps Google and other search engines better understand your pages and posts. This way it can be indexed appropriately and could even improve your website’s search engine ranking. This should move your posts higher on their search engine results page or SERP.

As an Amazon Associate we earn from qualifying purchases.

Advertisement

Structured data could also help your pages get added to the “Interesting Finds” feature in Google mobile searches. Having AMP pages (a separate topic) and structured data can even get your pages ahead of higher-ranking sites in the “Interesting Finds” section. This is why adding structured data is so important in your SEO strategy.

How People Usually Add Structured Data In WordPress And Why it Doesn’t Work So Well

Most people who are not advanced web developers have not used structured data at all or have used a plugin. A good plugin will to the job for you but will give you only standardized schema markup. You will not be able to customize your structured data and it will come across as generic. You will get only a small SEO benefit.

Also, with the free plugins you will not be able to generate schema types like product reviews, how-tos, events, recipes, etc. Now these kinds of markup are the ones that give you a real SEO boost. Without them, there is not much point in having a plugin for adding structured data.

Lastly, all the plugins which automatically add structured data markup that we have tested are actually quite bothersome. They can mess up other parts of your site and are hard to control. Plus, once they add schema to your post, it is not easy to remove it later. Perhaps the premium versions are OK but we strongly suggest that you avoid using plugins for adding rich snippets and structured data to your WordPress website.

How To Add Structured Data To Your WordPress or Other Website

If you want to get the most from the content and message of your Google rich results, you need to do it yourself. Here you will learn how to easily add structured data codes to your website posts and pages. Google prefers schema markup done in the JSON-LD format. So we will use that here as well.

No coding knowledge is needed and our approach is real simple. You will find examples in Word files that you can download from this article. Tweak them with your information and you are good to go. Finally, we will show you a quick way to add your individualized structured data to the “head” section of each post or page. Once you create a schema type for one post or page, it is just a matter of a copy-paste-edit job in Word to use it for all your other cases.

1. Generate JSON-LD Structured Data Markup

We will show you how to create your structured data or JSON-LD code. The first is with Google’s Structured Data Markup Helper. Surprisingly, even though this tool comes from Google, it often does not have all the required options in it. So you end up with errors and warnings making your rich results ineligible for Google rich results. If you start with Google’s tool, you will still need to add some additional lines of coding. Our examples will help you with the missing pieces of structured data though.

The second approach, and the one we recommend, is to directly use our JSON-LD examples here and edit out the parts we prompt you to in Word. This way you have complete, error-free code ready to use in your website.

But let’s walk through the approach with the markup done directly by Google. You will soon see below why this is not our preferred way.

Google’s Structured Data Markup Helper

Go to Google’s Structured Data Markup Helper which you will find here. Choose the relevant schema type and enter the URL of your post or page. You will see a screen like the one shown below. Click the “Start Tagging” blue button.

Screenshot of Google's Structured Data Markup Helper showing how set up the initial URL and select the Schema markup type.
Google’s Structured Data Markup Helper

The tool then pulls up a view of your page on the left and prompts you for the structured data it wants you to tag on the right. Below is a view from one of our previous posts.

Screenshot of Google's Structured Data Markup Helper showing you how to tag your live web page or post.
Google’s Structured Data Helper: Tagging Data

The process is self-explanatory and involves highlighting relevant parts of your post that will be marked up. After highlighting, right-click and select which tags they correspond to. In the example above, the name of the article was highlighted and the “Name” tag was assigned to it by right-clicking.

If the tags needed do not appear on your post, they can be entered by you manually by clicking on the “Add Missing Tags” button on the bottom right of the helper.

Once you have tagged everything, click on the “Create HTML” button and you will see the JSON-LD code that you need to place in the HTML of your site. Don’t worry, there is an easy way to add this code to your post and it is described later in this article.

Screenshot of Google's Structured Data Markup Helper showing you how to generate JSON-LD Code after tagging.
Google’s Structured Data Markup Helper JSON-LD Code Snippet

Unfortunately, we will see that the code that Google created above has missing information and won’t work correctly unless fixed. That’s why we wrote this article and recommend you use our code directly and skip Google’s Structured Data Helper.

Use Our Word Examples For Your JSON-LD Code — Recommended Method

Download the relevant Word file for your schema type that you will find below. The parts in red text need to be edited and changed to information for your own post. The text in blue contain instructions and need to be deleted as well. Don’t change or delete anything else.

Article Structured Data JSON-LD Code Snippet Example

Book Review Structured Data JSON-LD Code Snippet Example

Product Structured Data JSON-LD Code Snippet Example

Job Posting Structured Data JSON-LD Code Snippet Example

FAQs Structured Data JSON-LD Code Snippet Example

Local Business Structured Data JSON-LD Code Snippet Example

Event Structured Data JSON-LD Code Snippet Example

How-To Structured Data JSON-LD Code Snippet Example

Recipe Structured Data JSON-LD Code Snippet Example (Eligible for Google search and Google Assistant)

Breadcrumbs Structured Data JSON-LD Code Snippet Example

Organization (Logo) Structured Data JSON-LD Code Snippet Example

If you need code for a type not provided above, email us the link to your post or page at shaund.mendonsa at gmail dot com. Tell us what structured data you want along with pertinent information, and we will email you back the correct code to use.

Merkle Schema Markup Generator

A good online generator of JSON-LD schema that we like is the Merkle Schema Markup Generator. Go to their site and follow the easy instructions to generate codes for several schema types.

2. How To Test Your Structured Data And Schema Markup

Now we need to check our structured data for errors and completeness. Let’s test the JSON-LD code snippet we generated with Google’s markup helper above for errors or warnings using Google’s Structured Data Testing Tool. Choose the “Code Snippet” option and paste your JSON-LD code in.

Screenshot of Google's Structured Data Testing Tool where you paste your JSON-LD code snippet to see if there are any errors.
Google’s Structured Data Testing Tool Code Snippet

Click the green “Run Test” button and Google will analyze your code. Given that we did all the tagging in Google itself, you would expect to find your code error and warning free. But alas, this is almost never the case. Look below and you will see that we ended up with two errors and three warnings.

Screenshot of Google's Structured Data Testing Tool showing that the code from Google has two errors and three warnings.
Google’s Structured Data Testing Tool Code Snippet Test Results: Two Errors, Three Warnings

How To Fix Structured Data Errors

Scrolling down we see what the issues are:

Screenshot of Google's Structured Data Testing Tool Code Snippet test results showing what structured data is missing.
Google’s Structured Data Testing Tool Code Snippet Test Results: Two Errors, Three Warnings

We are missing the logo, headline, dateModified, and mainEntityOfPage fields. Without these your rich snippets won’t appear in search results. The frustrating part is that when we did all the tagging in Google’s own markup helper, there were no options to add any of these missing fields. Not even with manual tagging.

That’s why we recommend you save your time and skip Google’s markup helper. Directly use the JSON-LD code examples we provided above in step 1.

Now with code we wrote ourselves and have provided above for article schema, let’s test it with Google’s Structured Data Testing Tool.

Google's Structured Data Testing Tool results from structured data that we generated manually showing no errors or warnings.
Google’s Structured Data Testing Tool Code Snippet Test Results: No Errors

Everything is fine with no errors or warnings. Our structured data will be eligible for rich results in Google searches.

3. Add JSON-LD Markup To The Head Section Of Your WordPress Page Or Post

This section will show you where to put structured data in the HTML of your page or post.

If you are an advanced webmaster, you will not need help with adding HTML code to the head of your posts and pages. But for the rest of us there is an easy way. In WordPress, it involves using a free plugin called WordPress HTML created by Richard Stanton. This plugin lets you add HTML to the body or head section of either pages or posts via the “Custom Fields” option in WordPress editor.

Download and activate the WordPress HTML plugin. Once done, make sure that your custom fields are visible and enabled. To do this, go to the WordPress post editor, click on the three dots on the top right. Select options and make sure the “Custom Fields” box is checked. This is sometimes disabled, so it is a good idea to check first.

Screenshot showing the WordPress Custom Fields Options Enabled.
WordPress Custom Fields Options Enabled

When the WordPress HTML plugin is installed, scroll all the way down when editing a post or page and you will have the ability to add a “head” custom field now. Select “head” and then click on the “Add Custom Field” button.

Screenshot of WordPress HTML Plugin showing how to add the Head Custom Fields option.
WordPress HTML Plugin “Head” Custom Field

In the “Value” field, paste in your JSON-LD code snippet and click on the “Update” button in the custom fields section.

Screenshot of WordPress HTML Plugin Head section showing how to add your JSON-LD code to your post or page.
WordPress HTML Plugin Head: Adding JSON-LD Code To Post

At this point, your JSON-LD code has been added to the head of your post or page. Now click on the”Publish” or “Update” or “Save Draft” button in WordPress editor to update/save your post This is the easiest way to add structured data to your WordPress website. And you will have full control of the your rich results in Google.

If you have multiple structured data types for the same post or page, simply paste in the second or third sets of JSON-LD codes one after the other in the same head section you created in custom fields. Do not create separate “head” sections in custom fields. They won’t be read.

4. Test Your Live Page With Google’s Structured Data Testing Tool

Now that your structured data and schema markup have been added to your website page or post, you will want to do a final check for errors or warnings. Again, use Google’s Structured Data Testing Tool. But this time, use the “Fetch URL” option. Since your page is live, we want to see if Google is able to read the code we added in.

Screenshot of Google's Structured Data Testing Tool showing how to enter the post URL and run the test.
Google’s Structured Data Testing Tool: Fetch URL

The test will tell us which kinds of structured data were detected and whether there were any errors. In the example below, we added logo (organization) and article schema to this post. And there are no errors or warnings.

Screenshot of Google's Structured Data Testing Tool showing what structured data was detected by Google. For this example, Organization and Article schema was detected with no errors.
Google’s Structured Data Testing Tool: Fetch URL, No Errors

One more thing to note is that if you have errors, your rich results will not appear. Warnings are not so critical, your rich results will still appear but they may not be fully optimized. So it is a good idea to also fix any warnings.

5. Preview Your Pages And Posts, And Monitor Rich Results in Google Console

Preview Your Post Or Page With Google’s Rich Result Test

The last, and most rewarding step, is to get a first-hand look at how your marked up posts will appear in a live Google search. Use Google’s Rich Result Test for this. You can either use the URL of the page or simply enter in the code. The rest is self-explanatory. We previewed the how-to schema markup from this post in the rich results tool and this is what the how-to rich snippets looked like:

Screenshot of Google's Rich Results Test showing what the How-to Preview of this article will look like in a live Google search.
Google’s Rich Results Test: How-to Preview Of This Article

Monitor The Enhancements From Your Site In Google Search Console

If you have a verified website in Google Search Console, you can have your page or post crawled and re-indexed. Use the “URL Inspection” tool for this and request indexing. After Google has re-indexed your post, you can check again with the “URL Inspection” tool to see if the enhancements from your structured data were detected by Google.

Screenshot showing how to check each of your web posts in Google Search Console to make sure your enhancements are showing up.
Google Search Console Check Of Enhancements

Not all schema markup types are currently supported in the Google Console check. In the example above, breadcrumbs, the sitelinks searchbox, and logos were detected. The article schema that was also included did not get picked up. Google does not currently support article schema in its console. However, it is still active and will appear as rich results. The main test if whether your schema markup is detected in the Structured Data Testing Tool. If it is picked up there, you are all set and don’t need to worry about what shows up in the search console.

The schema types that are currently supported in Google Search Console and the Rich Results Test are breadcrumbs, dataset, sitelinks searchbox, logo, FAQs, fact check, event, job posting, how-tos, product, Q&A, and recipe.

Additional Resources For Adding Structured Data And Schema Markup To Your WordPress Website

The markup you add must be truthful. It should correctly represent the content on your site. Google runs algorithmic and manual checks on structured data that you add. If they find it not representative, there will be punitive action.

If you are writing your own schema and need help with some of the terms or if you generate errors with the structured data testing tool, go over to Schema.org and search their site for help with this.

Feel free to reach out to us as well. We’ll be happy to help you add structured data to your WordPress site. Good luck with your rich results and your website’s SEO.

If your are looking for a simple way to improve your SEO, adding structured data in your WordPress website is the way to do it. Use our schema examples and the WordPress HTML plugin and easily add rich snippets to your website.


Shaun Mendonsa, PhD is an influencing expert and pharmaceutical development leader. And sometimes, an occasional webmaster. He writes on the topics of influence and persuasion, and develops next generation drugs in human pharma by advising international pharmaceutical CROs and CMOs.


Keywords

How to add rich snippets, structured data and schema markup to a WordPress website without a plugin; Google rich results; how to improve your SEO performance with structured data, Schema.org; structured data enhancements

As an Amazon Associate we earn from qualifying purchases.

When you purchase an item through coupons or links on our site, we may earn an affiliate commission.

Advertisement

Share your thoughts

This site uses Akismet to reduce spam. Learn how your comment data is processed.