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 relation between entities and offer a more realistic understanding than just matching search queries with plain text.

And to help you win this area to have the edge over the competition, Rank Math has over 20 built-in Schema Markup types and 193 Local Business types. In addition to that, you can always add a new Schema Markup 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 how to use Schema Templates with some popular use-case scenarios, import Custom Schema from your competitors, and include them in your pages to keep up with the competition.

What Are Schema Templates? PRO

As it goes with the name, Rank Math lets you create Schema as a template, allowing you to reuse wherever you require them without having to create one from scratch every time.

Schema Templates are available in Rank Math PRO. To enable Schema Templates, at first head over to WordPress Dashboard > Rank Math and enable the Schema (Structured Data) module.

Enable Schema (Structured Data) module in Rank Math

Once you’ve enabled the Schema module, the Schema Templates submenu will be available under your Rank Math menu in the WordPress admin area.

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 only the required properties are used, while a vast number of sophisticated Schema Markup types and their properties are left to be explored.

If you want to mark up 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 lets you add extensive Schema properties that search engines could understand and relate your content better than before.

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

1 Using Custom Schema Markup Types

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

2 Save Time & Make Changes Faster

The Schema Template you create with Rank Math can be saved and added to your pages based on the display condition you set. Thus giving you a robust experience to carefully plan and implement Schema Markup to your entire website.

3 Set and Forget

While creating your Schema Template, you can use the selected variables inside your properties. And when you publish your content, Rank Math can automatically populate all the required values for these properties so that you don’t have to manually add them for each article.

Creating Schema Templates

Without further ado, let us create a Schema Template. To start creating your Schema Template, navigate to WordPress Dashboard > Rank Math > Schema Templates.

Rank Math - Schema Templates

The Schema Templates page will open up, and Rank Math will show all your Schema Templates here if you’ve created any. 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 customizations 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 tab, all your existing Schema Templates will appear here so that you can easily make changes to any of your existing Schema Templates and save them as a new one.

Your Templates available in Rank Math Schema Generator

To help you quickly find the data type you want with ease, we’ve added a search feature at the top of your Schema Generator.

Search for a Schema Template in Rank Math Schema Generator

When you click the Use option adjacent to any of the Schema Markup types, the edit window will open, and you can start editing. If you wanted to create a custom Schema Type from scratch, click the Custom Schema tab, and the edit window will look like this.

Create a Custom Schema in Rank Math

Editing Schema Templates

When it comes to structured data, hierarchies are important as they define the relationship between different properties. And Rank Math’s Custom Schema Builder lets you visualize the hierarchy when you add properties and groups.

Hierarchical lines in Rank Math Schema Builder

Add Property

When you click the Add Property option, a new row will be added beneath the current one, where you can enter the key and the value for the property.

Choose Add Property in Custom Rank Math Schema Builder

Add Property Group

By clicking the Add Property Group option, you can define a group of properties added as a child to the existing property group.

Add New property group in Custom Schema Builder


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

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


If you have a large website and decide to implement a new Schema Markup for the entire website, it would not be easy to enter the data for each post manually. Thankfully, our Schema Templates lets you use variables inside your properties; hence if Rank Math finds any data assigned for these variables, it populates 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.

%currenttime(F jS, Y)%
%date(F, jS, Y)%
%modified(F, jS, Y)%
%categories(limit=3 & separator = | & exclude= 12, 23)%
%tags(limit=3 & separator = | & exclude= 12, 23)%
%randomword(word1| word2| word3)%

For instance, if you wanted to create an Article Schema Markup with copyright information, you can easily add them to all pages with variables.

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 additional information for each article for this Schema Markup other than the default ones.

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; you can achieve each more complex structured data with variables. Thus Rank Math offers you a powerful tool for Schema Markup implementation.

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 to be modified.

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 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 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.

Validation Results in Google Rich Results Test Tool

Note: When you run a Google Rich Results Tool 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 Google Structured Data Testing Tool.

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 set. To set a condition for adding the Schema Markup, click the Display Conditions tab in your Custom Schema Builder.

Entire Site

When you choose to add 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.


You can also choose to add the Schema Template to All Archives or specifically to Author pages, Search pages, Categories, Tags, or other custom taxonomies you’ve created on your website.

Include Rank Math Schema Template in archives


When you choose the Singular option, you can choose to add the Schema Markup to all post types, posts, pages, or your 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 belongs to specific categories or tags or formats.

Include Rank Math Schema to post under specific categories

Add New Condition

When you click the Add New Condition option, you can add another condition and combine it with Include/Exclude setting to add/remove Schema Template wherever you wanted to.

Add New Display Condition to your Schema Template

Use Case Scenarios

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

Using Schema Templates for AggregateRating

If you’ve added Product Schema to your content with Rank Math but did not add any actual product reviews from your buyers/customers to your page, then you could notice the Rich Results Test tool giving a warning that aggregateRating is missing.

Although it is only a warning/recommendation, you can use any review plugin to allow visitors to leave ratings on your website if you choose to get rid of it. You can integrate those values with Rank Math AggregateRating Schema Markup by using the following custom Schema Markup.

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 (they can also add this Review Schema Markup on their 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. However, you can also add your values manually to these fields.

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. We can even create a custom Local Schema Markup and add it to all our web pages.

Rank Math supports Local Schema Markup by default, and it is available under the name ‘Organization‘ in your Schema Catalog. It includes all the recommended properties for the Schema to be valid. You can always include more properties in your Schema, and in this example, we’re adding a property award to add one that your Local Business has received.

Custom Local SEO Schema Markup with award property

For the custom Local SEO Schema Markup we’ve created, you can generate the Schema Code in the Code Validation Tab.

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

Now, you 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.

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, we would try to import a news article that has LiveBlogPosting Schema added to it to use the same in your website.

LiveBlogPosting Schema: Use this Schema Markup 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 start importing Schema, click the Import tab in the Schema Generator.

Import Schema Code from URL/Online Page

To import Schema Markup from any page, click the URL/Online Page under Import Schema Code from and add the URL to import in the Page URL field and choose Import.

Import Schema Code from URL/Online Page

Import Schema Code from HTML Code

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

Import Schema code from HTML code

Choose HTML Code in 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 JSON-LD/Custom Code

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

Import Schema code form JSON-LD/Custom code

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

Choosing the Schema Markup to Import

A single page can have multiple Schema Markup types, and when you import the Schema Markup, Rank Math lets you choose the Schema Markup type you wanted to use to build your Custom Schema Markup. Click the Use option that is available next to the Schema Markup type.

Choosing specific Schema Markup to import

In the Edit tab, change the values you wanted to edit and click the Save button.

Save the imported Schema Markup

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 one, open the article where you want to add this Schema Markup.

In your right sidebar, click the Rank Math icon and navigate to the Schema Tab. And then click the Schema Generator.

Schema Generator on single pages (Block Editor)

If you’re using Classic Editor, scroll down to the bottom of the page, where you’ll find the Rank Math section, and click the Schema tab.

Open Schema Generator in single plages (Classic Editor)

In the Schema Generator, click Your templates section to find the Custom Schema Markup we’ve just created and 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 Google Structured Data Testing tool for errors/warnings and fix them accordingly.

And, that’s it! If you still have any questions on using Schema Templates, feel free to reach our support team – 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