Cyber Monday Friday Offer & $4,000+ In Bonuses!

Know more.
  1. Home
  2. Knowledge Base
  3. How to Use Schema Templates in Rank Math PRO

How to Use Schema Templates in Rank Math PRO

Schema Markup is expected to impact the future of SEO as they keep evolving with more data types. Certainly, it does, as it helps search engines to understand the relationship between entities and, in fact, offers a more realistic understanding.

And to help you win this area to have the edge over the competition, Rank Math has got over 20 built-in Schema types and 193 Local Business types. In addition to that, you can always add a new Schema type with our Custom Schema Builder and save them as a Schema Template to use them anywhere inside your content.

In this knowledgebase article, we’ll show you how you can use Schema Templates with some popular use-case scenarios and how you can import Custom Schema from your competitors for adding them to your pages.

1 What Are Schema Templates? PRO

As it goes by the name, Schema Markup can be saved as a template with Rank Math, so that you can reuse them inside your website without having to create it every time from scratch.

Schema Templates are available only in Rank Math PRO. If you haven’t started using Rank Math PRO yet, you can choose a PRO membership of your choice and get started in no time.

To enable Schema Templates, at first, head over to WordPress Dashboard > Rank Math > Dashboard > Modules and then enable the Schema (Structured Data) module.

Enable Schema (Structured Data) module in Rank Math

Once you’ve enabled the Schema module, Schema Templates will now be available under the Rank Math menu inside your WordPress dashboard.

2 Why Do You Need to Use Schema Templates?

The official Schema.org documentation has got over 750 Schema Markup types. However, in practice, only a very few structured data types with limited properties are being used widely. As a result, many sophisticated Schema types and their properties are still left to be explored.

If you want to markup your content with extensive Schema properties than just the trivial ones, fortunately, Rank Math’s Schema Templates will be your go-to tool. With minimal effort, Rank Math allows you to markup your content with extensive Schema properties, making it easier for search engines to understand and relate your content better than before.

Rank Math’s Schema Templates will let you enjoy the benefits of:

2.1 Using Custom Schema Markup Types

With our Custom Schema Builder, you can build any advanced Schema type with properties and property groups. We’ve built the tool with care so that you can enjoy the advantage of implementing structured data even for the less popular types, for which search engines might consider introducing a rich snippet in the future.

2.2 Save Time & Make Changes Faster

Your Schema Templates can be added to any page on your website by setting a display condition, in fact, you can take advantage of this feature to carefully plan and add the Schema Markup to your entire website.

Note: If you don’t want to set a display condition, you can directly use the Schema template on any page under the Schema tab in Rank Math’s Meta Box.

2.3 Set and Forget

While creating your Schema Template, you can make use of the predefined variables and assign them as values for various Schema properties.

And when you do, Rank Math can automatically populate values for these properties when the content is published, so you don’t have to manually add the values for each post.

3 Creating Schema Templates

Without further ado, let us get started with creating a Schema Template. At first, head over to WordPress Dashboard > Rank Math > Schema Templates.

Open Schema Templates

The Schema Templates page will now open up, and all your existing Schema Templates will appear here. If this is the first time, you’re creating a Schema Template, you wouldn’t find anything here.

To create a new Schema Template, click Add New button.

Add new Schema Template in Rank Math

Schema Generator will prompt on your screen. If you choose to add/remove properties from the existing Schema Markup types inside Rank Math, you can choose one from the Schema Catalog. Since you’ll be saving these changes as a template, the default Schema types available with your Rank Math plugin will not be affected, so you can feel free to use them.

Rank Math Schema Templates - Schema Generator

When you click the Your Templates option, all your existing Schema Templates will appear here. You can even edit your existing Schema Templates with more Schema properties and save them as a new template.

Your Templates available in Rank Math Schema Generator

If you’ve created a number of Schema Templates, then finding a specific template would become difficult. In this case, to help you quickly find the Schema type/template, we’ve added a search box at the top of Schema Generator. The search box is AJAX-based, and as you start typing a keyword, the Schema types will be filtered based on the keyword.

Search for a Schema Template in Rank Math Schema Generator

When you click the Use option against any of the Schema types, the edit window will open, and now you can start editing.

4 Editing Schema Templates

You may edit an existing Schema type/template as we discussed above or alternatively click the Custom Schema tab to create a new Schema type from scratch. The edit window over there will look like this.

Create a Custom Schema in Rank Math

Now, let us discuss each option available here in the Schema Builder.

4.1 Hierarchies

When it comes to structured data, hierarchies are important as they define the relationship between different properties and property groups. And when you start adding properties and property groups, Rank Math’s Custom Schema Builder will let you visualize the hierarchy easily with clearly marked lines, as shown below.

Hierarchical lines in Rank Math Schema Builder

4.2 Add Property

When you click the Add Property option, a new row will be added below the current one, where you can enter the property’s name and its value.

Choose Add Property in Custom Rank Math Schema Builder

4.3 Add Property Group

A property group is nothing but a set of related properties grouped together. By clicking the Add Property Group option, you can create a new property group and start nesting relevant properties under this property group.

Add New property group in Custom Schema Builder

4.4 Duplicating Property/Property Group

The Schema builder also lets you duplicate any property or property group to help you quickly create properties and groups. Click the copy button against the property to create a duplicate of it.

Duplicate property in Schema Builder

In a similar way, you can duplicate property groups by simply clicking the Duplicate Group option.

Duplicate property group

4.5 Delete

You can use the Delete option to remove the corresponding property/property group. Be aware that when you delete a property group, all the nested properties inside the group will also be deleted.

Delete a property or property group in Custom Rank Math Schema Builder

4.6 Variables

If you have a large website and decide to implement a new Schema Markup for the entire website, it would be tedious to enter each post’s data manually. Thankfully, Schema Templates lets you use variables for property’s values; hence if Rank Math finds any data assigned for these variables, it would automatically populate the value for these properties in the Schema Markup.

The following variables are available to use inside Rank Math Schema Templates, and you can refer to this detailed resource on our variables to understand the data they pull out.

%sep%
%search_query%
%count(varname)%
%filename%
%sitetitle%
%sitedesc%
%currentdate%
%currentday%
%currentmonth%
%currentyear%
%currenttime%
%currenttime(F jS, Y)%
%org_name% 
%org_logo%
%org_url%
%title%
%parent_title%
%excerpt%
%excerpt_only%
%url%
%post_thumbnail%
%date%
%date(F, jS, Y)%
%modified%
%modified(F, jS, Y)%
%category%
%categories%
%categories(limit=3 & separator = | & exclude= 12, 23)%
%tag%
%tags%
%tags(limit=3 & separator = | & exclude= 12, 23)%
%term%
%term_description%
%customterm(taxonomy-name)%
%customterm_desc(taxonomy-name)%
%userid%
%name%
%id%
%focuskw%
%customfield(field-name)%
%page%
%pagenumber%
%pagetotal%
%pt_single%
%pt_plural%
%customterm(post_format)%
%customterm_desc(post_format)%
%randomword(word1|word2|word3)%
%randomword_np(word1|word2|word3)%
%wc_price%
%wc_sku%
%wc_shortdesc%
%wc_brand%

For instance, if you want to create an Article Schema Markup with copyright information, you can easily add them to all your existing pages with variables, as shown below.

Article Schema with Copyright information

From the above image, you can notice that the entire Schema Markup is generated only with data from the variables. Hence, you don’t need to add any additional data for your articles to generate a valid Schema Markup.

Now, you can set the display condition to singular posts (which we’ll discuss in this article shortly), save it, and forget it, while Rank Math would automatically add this Schema Markup to all your blog posts.

This is only a simple example, but you can achieve even more complex structured data with variables, giving you endless opportunities to explore.

5 Testing and Validating Your Structured Data

Now that you’ve built your Custom Schema Markup, you need to check if the generated Schema Markup is valid or if it requires any improvement.

Rank Math generates the JSON-LD code for the Schema Markup you’ve created and makes it available under the Code Validation tab.

Code Validation in Rank Math Custom Schema Builder

You can click the Copy button and validate the code in Google Rich Results Test Tool. In the Rich Results Test tool, click the Code tab and add the copied code to the text area available here.

Validate your code in Google Rich Results Test tool

Click the Test Code button and wait for a few seconds to let the Google bot validate the code and generate the results. If there are any issues with your code, it will be shown in the validation results, so that you can go back and fix them.

Google's rich results code validation result

Note: When you run a Google Rich Results Test, it can only detect Schema Markup types that Google officially recognizes and features rich snippets for. However, if you wish to test other types, you can use the Schema Markup Validator.

6 Display Based on Conditions

As we mentioned earlier, Schema Templates make it easier to add structured data to your website based on the conditions you’ve set. To set a condition for adding the Schema Markup, click the Display Conditions tab in your Custom Schema Builder.

Now, let us discuss each display condition in detail.

6.1 Entire Site

When you choose to include the Schema Template to the Entire Site, your Schema Markup will be added to the entire website, be it homepage or posts or pages or archives.

Add Schema Template to the entire site

6.2 Archives

When you choose the Archives option, you’ll be able to add the Schema Template to All Archives or specifically to Author pages, Search pages, Categories, Tags, or archives of other custom taxonomies you’ve created on your website.

Include Rank Math Schema Template in archives

6.3 Singular

When you choose the Singular option, you’ll be able to add your Schema Template to all post types or only to posts, pages, or custom post types you’ve created on your website.

Include Rank Math Schema Template to all post types

You can even go further to add Schema Markup only to posts that belong to specific categories, tags, or post formats.

Include Rank Math Schema to post under specific categories

It is also possible that you can simply look for the specific posts or pages to add your Schema template.

Include specific posts in Schema Templates

6.4 Add New Condition

When you click the Add New Condition option, a new row appears below to add another condition. In this way, you can combine your conditions with Include/Exclude setting and add Schema Templates more accurately only to the pages you want to add.

Add New Display Condition to your Schema Template

7 Use Case Scenarios

Now that we’ve discussed creating Schema Templates in detail, we’ll look at some of the popular use-case scenarios of Schema Templates.

7.1 Using Schema Templates for AggregateRating

If you’ve added product-based Schema to your content, Rank Math looks for any actual product reviews from customers present on your page. If it is unable to find, Rank Math does not add the AggregateRating Schema Markup, and it would be reflected in the Rich Results Test tool with a warning — aggregateRating is missing.

Although it is only a warning/recommendation, if you choose to get rid of it, you can make use of any review plugin that allows visitors to leave ratings on your website. Finally, you can integrate those values with a Schema Template so that Rank Math can add AggregateRating Schema Markup to your product pages, as shown below.

AggregateRating Schema Markup with Rank Math

For the @type field ensure that you set a review data type that Google accepts and the one that is relevant to your website content.

Note: Depending upon the review data type you’ve set, you might require additional properties to be added. Validate the code in Google Rich Results Tool for the suggestions, and you can add them accordingly.

For this example, we’re using the WP Review plugin (which can also add this Review Schema Markup on its own) to allow visitors to add review ratings. We’re using the variables %customfield(wp_review_user_reviews)% and %customfield(wp_review_review_count)% to provide values for the properties ratingValue and ratingCount respectively. However, you can also add values to these fields manually.

7.2 Using Schema Templates for Adding Custom Local SEO Schema Markup

As we mentioned earlier, Schema Templates are useful when you want to add more extensive properties to your Schema. By using a Schema Template, you can even create a custom Local Schema Markup and add it to all your web pages.

Rank Math supports Local Schema Markup by default and the relevant Schema properties are added when you configure the Local SEO settings in Rank Math.

But if you want to include more properties to your Schema, you can deactivate the Local SEO module and generate a custom Local SEO Schema with the Schema Template. In this example. we’ll build a custom Local SEO Schema that includes an additional property award, to include the award your Local Business has received.

Custom Local SEO Schema Markup with award property

For the custom Local SEO Schema Markup we’ve created, the Schema code can be generated in the Code Validation tab.

Validation of JSON-LD code of custom Local SEO Schema Markup with example

Now, we can validate the code on the Google Rich Results tool for any errors. To display the Schema Markup on all pages, click the Display Conditions tab and set the Schema Markup to be added to the Entire Site.

Note: If you’re adding custom Local Business Schema to your webpages as we’ve shown above, ensure that you’ve deactivated the Local SEO module in Rank Math, to prevent any duplication in Schema.

7.3 Using Schema Templates to Extend Rank Math Schema

In the previous example, we’ve discussed about adding a custom Local Business Schema. And it also required to remove the default Local Business Schema added by Rank Math to avoid duplicating the Schema properties.

Instead of adding the complete Schema, it is also possible that you can extend the default Schema added by Rank Math. This would be of more help in cases, where you want to add only a few properties to the existing Schema, without having to repeat them all once again.

The Schema generated by Rank Math for the built-in Schema types are clearly marked with distinct @id. As you can notice from the below image, Rank Math already includes the @id, when the Schema is added by the Local SEO module.

Id in Rank Math Schema

Now to extend this Schema, all you need to do is use the same @id once again. So the same award property which we discussed in the previous example can be easily added with a Schema Template like this:

Schema Template for extending Rank Math Schema

Then set the Display Conditions to make the Schema available on all pages with the Entire Site option.

Since we’ve used the identifier in this case, Google and other search engines can clearly link the Schema we’ve added. We can also validate the same in Google’s Rich Results Testing tool to see how the Schema is being interpreted. As you can notice from the below image, Google has linked the award property we’ve added with the Local Business Schema generated by Rank Math.

Google interpreting node identifiers

By following this method, you can extend any Schema type built with Rank Math. All you need to do is to ensure that your @id matches with the one that Rank Math generates. Even the slightest mismatch in the identifier could prevent search engines from linking the Schema and end up with warnings. So we recommend testing them with Google’s Rich Results Testing tool before implementing them sitewide.

8 Importing Schema Markup from Other Websites

Apart from creating Custom Schema Markup from scratch, Rank Math also supports importing Schema Markup directly from other websites, making it easier for you to build a template.

Rank Math can import Schema directly from a page or from HTML/JSON-LD code that you enter. For instance, you can try importing a news article that has LiveBlogPosting Schema added to it. Rank Math would identify the Schema Markup used in the news article and makes it readily available so that you can edit and reuse them on your website easily.

LiveBlogPosting Schema: Use this Schema Markup only if you’re covering a live event on your blog post with continuous updates. The search result will feature a live badge as a rich snippet.

To get started with importing Schema, navigate to the Import tab under the Schema Generator. Rank Math lets you import Schema in different ways, and we’ll discuss each method in detail.

8.1 Import Schema Code from URL/Online Page

You can import Schema Markup directly from any page available online. Under the Import Schema Code from drop-down list, choose URL/Online Page. In the Page URL field, enter the URL of the page that includes the Schema Markup you want to import. And then, click Import.

Import Schema Code from URL/Online Page

8.2 Import Schema Code from HTML Code

You can also import Schema from HTML code. To get the HTML code of any page, right-click on the page and choose View Source or use the keyboard shortcut (Ctrl + U — in Windows and Option+Command+U — in Mac).

Now, choose HTML Code from the Import Schema Code from drop-down list and paste the HTML code you’ve copied in the text area. Click the Process HTML button.

Import Schema code from HTML code

8.3 Import Schema Code from JSON-LD/Custom Code

Similar to the HTML code, Rank Math can also import Schema from JSON-LD/Custom code.

Choose JSON-LD/Custom Code in the Import Schema Code from drop-down list and add the code to the text area. Then, click the Process Code button.

Import Schema code form JSON-LD/Custom code

8.4 Choosing the Schema Markup to Import

Once Rank Math has imported the Schema Markup, you’ll see a confirmation with the list of Schema types found. In practice, a single page can have multiple Schema Markup types. But you may not require to use all the imported Schema types.

So, when you import Schema, Rank Math lets you choose the Schema type you want to use for building your Custom Schema Markup. Click the Use option against Schema type to edit the Schema Markup.

Choosing specific Schema Markup to import

In the Edit tab, you can change the values you want to edit, and once done, click the Save button. Now the Schema Markup has been saved as a template, and it is readily available for use.

Save the imported Schema Markup

8.5 Using Custom Schema Markup Inside Single Blog Post

The Schema Template that we’ve just created can be also be used on specific blog posts. To add the Schema to a specific post, open the post, and in the Block Editor, choose the Rank Math SEO icon from the top right corner of the screen.

Or alternatively, click the three vertical icons from the top right corner and choose Rank Math from the Plugins menu.

Navigate to the Schema tab inside Rank Math Meta Box and then click the Schema Generator as shown below.

Open Schema Generator

If you’re using Classic Editor, scroll down to the bottom of the page until you find the familiar Rank Math Meta Box. Click the Schema tab and then choose Schema Generator.

Open Schema Generator in single plages (Classic Editor)

In the Schema Generator, choose Your templates to find the Custom Schema we’ve just created, and then click the Use option.

Using Custom Schema Markup inside single pages

In the Edit tab, change all the values according to your article and click the Save for this Post button.

Changing custom Schema Markup values relevant to an article

You can check the generated Schema Markup with relevant values in the Code Validation tab and validate them using the Rich Results Test tool or using Schema Markup Validator for errors/warnings and fix them accordingly. Now update the post or page as you would normally do, and if it is a new post, simply click the Publish button.

And, that’s it! We hope the tutorial was helpful in getting started with Schema Templates. Now, you can start exploring various Schema Markup types and extensive properties on your website. If you still have any questions on using Schema Templates, please feel free to reach our support team directly from here, and we’re always here to help.

Was this article helpful?

Still need help?

?

Submit Your Question

Please give us the details, our support team will get back to you.

Open Ticket