How to integrate rich snippets on your website [Step by Step]

What are rich snippets?

Rich snippets is a kind of data markup system which is released by Google. I help google to understand what is your content about. It helps google to improve search visibility well as usability

Why rich snippets?

You have to include rich snippets on your ecommerce website in order to get better visibility on google. Even if you rank on the first page and your position is not on the top 3 you have the chance to outrank your competition only by having rich snippets.

How to integrate rich snippets:

Step1: Define the type of your content

First of all select on which type of content you are trying to implement rich snippets. For instance, If you want to make rich snippet for article then you have to make code for article. Again, if you want to make rich snippet code for video then there is another type of code.

Step2: Make the code with the content

The code will depend on which type of content you are trying to make. You can use template or you also can generate code for your content from rich snippets code generator. Just Google it you will get the code. See the image below:

Step3: Allow Custom Field on your WordPress theme

So as we are trying to implement rich snippets we need to allow our code on our function panel. First Copy the code below:


$schemamarkup = get_post_meta(get_the_ID(), ‘schemamarkup’, true);

if(!empty($schemamarkup)) {

            echo $schemamarkup;



Then Paste it on the header file of your post and page. This will allow you to create rich snippets on your websites. You also can make a child theme for this

Also make sure you have allowed Custom filed on your page and field

Step4: Now paste the code in the custom field

After making the code copy it and then go to your post. Scroll down a little bit. You will see custom field option. Click on add new field and then name it “schemamarkup” on the value paste the code which you have copied. That’s it!

Step5: Publish the post and Check it with Google Structured Data Markup Testing tool

Now publish the post and cope the post url. Goto google structured data markup checking tool and paste your url on it. Click on the check button and check the code.

Leave a Reply