How to set up schema in RankMath
Adding schema to your website still plays a role in your overall SEO strategy and RankMath not only helps with basic settings like titles, archive metadata and indexing option but also creating custom complex schemas for nearly any type of a website. Schema markup is nothing more but structured data that supports search engines in explaining the context and content of the website they would be including in the search index. This standardized way to communicate the overall message of your website with a simple markup, can improve your site’s overall performance.
Starting with Schema
Schema will be different for each type of a website and to start you should refer to Schema.org where you can find standardized schema structures for sites like real estate, ecommerce, events, organizations, health agencies and more. Find schema that best represents the content of your website. Remember you can attach multiple schemas to your website and also multiple schemas to single pages on your website. Nearly every business website will need at least the very basic organization schema and ecommerce sites should have product schema included on all product pages.
STEP 1: SETTING UP SCHEMA USING RANKMATH
After opening the Schema Templates select the “New Schema” button in RankMath. You will see a popup window.
This window offers 3 basic options on starting the setup. You will see predefined schema templates available from the RankMath catalog.
Ready to use templates
From blog posts and articles to people and products, the most common schemas are predefined and ready to use. All you have to do is enter your variables into each filed which we will explain in step 2.
Import templates
You can also import templates from a URL, HTML Code or JSON-LD Code – the import function is available only in the PRO version of the plugin.
Custom Schema
Custom schema is the most helpful option as it can be completely customized based on the variables available in your data.
STEP 2: RANKMATH CUSTOM SCHEMA FIELDS
Start by referencing the data available for your type of schema against the schema.org just like you will see in the below example: https://schema.org/RealEstateAgent
We will be creating Real Estate Agent Schema using the data from our site and custom filed data we created for this custom post.
In this example you can see how we connect the data from our custom post with the schema fields. Some of the entries are native to to RankMath (for example %post_thumbnail%), but there will be situations, like in our example, where you have to enter either custom meta field (%customfield(field-name)%)
or custom taxonomy (%customterm(taxonomy-name)%)
. This is all possible with variables accepted by RankMath, listed in the lower part of the article.
STEP 3: CONNECT YOUR CUSTOM SCHEMA TEMPLATE WITH YOUR PAGES OR ARCHIVES
This is the last step and it must be completed in the same popup window. You can select to include or exclude the template base on the type of the page (singular, archive, all), post type and taxonomies.
List of RankMath schema variables including custom meta fields and custom taxonomies.
%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%