How to Add Schema Markup in WordPress & WooCommerce?

Schema markup helps you provide information about your website to search engines for improving your listing in the search results. It is a special set of HTML codes that can tell search engines about your site. For example, you can tell what a particular page is like blogs, FAQs, etc. Do you want fancy search results with star ratings on search engines for your WordPress or WooCommerce site? Hell, yes! Then, you better add schema markup in your WordPress/WooCommerce pages or posts. Learn below how to add schema markup for your WordPress & WooCommerce website.

All popular search engines, including Google, Yahoo, and Bing, use schema markup to display information in search results. So, it is important to add schema markup in your WordPress and WooCommerce sites for better ranking.

This article will walk you through the process of adding schema markup with and without a plugin.

Benefits of Schema Markup

  • Help search engines better understand your WordPress and WooCommerce website’s content.
  • Boost your brand presence online with a full Knowledge Graph featuring Google desktop searches.
  • Appear in rich results like the coveted stars to increase your click-through rate.
  • Make your website eligible for SERPs to get a better ranking.
  • ECommerce products get a special Buy Now CTA right in the Google Search Results Page.
  • Prepare your site for voice search via Alexa, Siri, and Google Assistant.

How to Add Schema Markup Without Plugin?

If you want to add schema markup to WordPress or WooCommerce without a plugin, you can go to Schema.org to find suitable markups to add to your content. Mainly search engines use 3 different code languages:

  • Microdata
  • RDFa
  • JSON LD

I will use JSON LD in this post since Google likes it the most. So, let’s take a tour to add a markup to your post or page using WordPress block editor.

Log into your WordPress dashboard and go to the Posts or Pages section to open a post to add it.

Make sure that Custom Fields are checked in the Options tab. Tap on the 3 dots in the top right corner and scroll down to the Options in the Tools section. Here you can check the Custom Fields box.

wordpress options

After that, scroll down in your post or page to the bottom, where you can find the Custom Fields settings.

custom field settings

Click on the Enter new tab under the Add New Custom Field.

enter new custom field

Name your schema markup for easy reference. Now copy the code snippet mentioned below and paste it to the Value section:

<script type="application/ld+json">
    {
      "@context": "https://schema.org",
      "@type": "NewsArticle",
      "mainEntityOfPage": {
        "@type": "WebPage",
        "@id": "https://google.com/article"
      },
      "headline": "Article headline",
      "image": [
        "https://example.com/photos/1x1/photo.jpg",
        "https://example.com/photos/4x3/photo.jpg",
        "https://example.com/photos/16x9/photo.jpg"
       ],
      "datePublished": "2015-02-05T08:00:00+08:00",
      "dateModified": "2015-02-05T09:20:00+08:00",
      "author": {
        "@type": "Person",
        "name": "John Doe"
      },
       "publisher": {
        "@type": "Organization",
        "name": "Google",
        "logo": {
          "@type": "ImageObject",
          "url": "https://google.com/logo.jpg"
        }
      }
    }
    </script>

After that, click on the Add Custom Field button and go to the top of the page to click on the Update and save the changes.

Finally, copy this code snippet and paste it in your header.php file:

<?php
$schema = get_post_meta(get_the_ID(), 'schema', true);
if(!empty($schema)) {
    echo $schema;
}
?>

Add Custom Code to Header.php File

The safest way to add custom markup code to the header.php file is using a plugin. You can use a plugin like Insert Header and Footer for the job.

Once you have installed and activated the plugin, go to the Insert Headers and Footers in the Settings menu.

You can see different windows to add your code to your website’s Body, Header, or Footer. Add your code snippet in the Scripts in the Header window. Click on the Save button, and your work is done.

How to Add Schema Markup With Plugin?

There are multiple plugins that can help you add it to WordPress. One of them is Schema Pro. You can get some of the verified Schema Pro discount codes to get up to 30% OFF on the plugin.

All in One SEO is another easy WordPress plugin to add schema markup. It is a powerful SEO optimization plugin that can add schema markup to your WordPress or WooCommerce site.

Go to Plugins > Add New to install and activate the AIOSEO plugin on your WordPress dashboard. After that, the plugin’s setup wizard will guide you through setting it up.

Once the plugin is set up, it will automatically add the accurate schema markup across your website. However, I’ll also show how to tweak all the schema markup settings manually on the AIOSEO.

Add Schema Markup Across Website

First, let’s learn how to tell search engines some basic information about your website. Navigate to All in One SEO > Search Appearance page > Scroll down to the Knowledge Graph section.

aioseo knowledge graph

You need to now select whether your website is a person or an organization. For an organization, you can add information like name, contact number, logo, etc.

On the flip side, if your website is a person, select the user account from the dropdown list. If you select an existing WordPress user, edit the selected user’s profile from the Users > Profile page.

user profile for knowledge graph

You can also add the user’s Twitter and Facebook profile links.

Finally, set up the user’s profile photo as a Gravatar. Hit the Update Profile button to save the changes.

Add Default Schema Markup

You can select default settings to generate schema markup for all your pages and posts. This will make sure schema markup is set up properly for all product pages, blog posts, or other content types.

Go to the All in One SEO > Search Appearance > Content Types tab. Here you can see all your post types listed.

content types in aioseo

For every post type, a Schema Markup tab is available. Switching to it will help you select the default schema type for the particular post type.

schema type in aioseo

You can review the settings and change them if required. For example, if you have a news website, you can change the Article Type to News Article schema.

How to Change Schema Markup for Each Post & Page?

Once default schema settings are set up, there is no need to change your schema markup for your content. However, there are a few scenarios where you want to adjust it for an individual post or page.

For instance, if you are using custom WordPress landing pages, you should tell this to search engines. To do so, edit the post or page that you want to modify. Then, scroll down to the AIOSEO Settings box and switch to the Schema tab.

schema fields in aioseo plugin

There are different types of schema markups available to select from. For example, if you select a Product schema type, you can add price, brand, etc.

Add Schema to Taxonomies

Using AIOSEO, you can also add schemas to your taxonomies. Go to AIOSEO > Search Appearance > Taxonomies tab. You will see schema type for each taxonomy for the content on your site, like tags, categories, etc.

Click on the Schema Markup tab to configure schema for a particular taxonomy.

How to Add Schema Markup for WooCommerce?

The AIOSEO plugin also works with WooCommerce websites. In addition, it can manage general SEO settings and select product schema markup for all your products.

add schema markup to woocommerce

The plugin can fetch metadata from your WooCommerce product listing, including price, reviews, and more.

Test Your Schema Markup

Once you add custom schema markup to your WordPress or WooCommerce site, use Google’s Structured Data Testing tool to test it.

You simply have to enter your website URL in the tool, and it will fetch the structured data markup found for the URL. If there is an error, revisit the schema markup settings on your website to fix it.

Final Words

I have shared both manual and plugin methods to add schema markup to WordPress and WooCommerce for your convenience. But I recommend using AIOSEO for your site. Because:

  • It can automatically add schema
  • Easy to edit schema settings
  • No coding hassle

However, if you can handle codes and have SEO knowledge, you can use the manual method too. So, now I will leave you to add schema markup to your website and get recognized by search engines!

Summary
How to Add Schema Markup in WordPress and WooCommerce?
Article Name
How to Add Schema Markup in WordPress and WooCommerce?
Description
Find out how to add schema markups in WordPress and WooCommerce to improve the search engine rankings of your website. [GUIDE]
Author
Publisher Name
Reviews N Guides
Publisher Logo

Leave a Reply

Your email address will not be published.