Sotavento Medios

|
Blog

How to Create Structured Data Markup for Rich Snippets

How to Create Structured Data Markup for Rich Snippets

Structured data is now a major factor for search engines. Schema.org was launched in 2011 by Google, Bing, Yahoo, and Yandex to establish a common set of schemas for the web. Since then, the database has seen numerous improvements.

Over time, the number of websites using structured data remains low, even though its benefits are clear. Google and other search engines have developed better ways to track and promote its use.

Google specifically enhanced the use of structured data with Rich Snippets to improve the look of search results.

What are Rich Snippets?

The structured data markup on a webpage helps Google and other search engines understand the content better. This leads to what are called “Rich Snippets” or “Rich Results.” These search results provide extra information based on the structured data from a webpage, enhancing user interaction.

Schema.org has a list of 614 types, 906 properties, and 114 enumeration values, which is quite extensive. From this vocabulary, Google has selected a few types that qualify for rich snippets.

As of this writing, Google supports the following types of rich snippets:

• Article

• Breadcrumb

• Book

• Carousel

• Corporate contact

• Course

• Critic Review

• Dataset

• Employer Aggregate Rating

• Event

• Fact Check

• FAQ Page

• How-to

• Job Posting

• Livestream

• Local Business

• Logo

• Media

• Occupation

• Product

• Q&A Page

• Recipe

• Review Snippet

• Sitelinks Searchbox

• Social Profile

• Software App

• Speakable

• Subscription and paywalled content

• Top Place list

• Video

Why Is it Important for SEO?

Rich snippets make regular search results more attractive and interactive for users. They provide a preview of the actual page content, making users more likely to click.

Structured data is not a direct ranking factor. Google had considered making it one but decided against it in 2017. They do not want to rely solely on structured data for better web understanding.

However, since structured data helps convey your website’s content, it allows bots to identify the relevance of your page and rank it for appropriate terms. Implementing structured data for rich results could also slightly increase your Click Through Rate.

How to Create Structured Data Markup

Even though structured data is not a direct ranking factor, adding it to your pages and optimizing for rich snippets is clearly beneficial. It can be intimidating for those who are not web developers, but Google provides many resources to help webmasters understand it better.

Structured data can be utilized in various formats like RDFa, Microdata, and JSON-LD. Keep in mind that Google prefers JSON-LD.

Use Google’s Structured Data Reference

On the Google Developers website, you can find a reference for all structured data types eligible for rich results.

How to Create Structured Data Markup for Rich Snippets

If you have a page that fits any of these structured data types, click on it to access a guide. This guide will include a brief introduction to the structured data type, an example of the markup, some content guidelines, and the definitions of the structured data type.

After familiarizing yourself with the type, click on the “See Markup” button to be redirected to either the Rich Results Test Tool or the Structured Data Tester Tool. This will show you a sample of valid code, such as for FAQ pages.

How to Create Structured Data Markup for Rich Snippets

Edit the Code to Match Your Content

Once you generate the code from Google’s reference, copy and paste it into a notepad or document for easier editing.

The changes needed are minimal, and the code is straightforward. You can quickly identify the information you need to include. For cases like FAQs and How-Tos, the sample code might be brief. In those instances, simply copy the relevant section of code where you need to add more information.

Here’s a snippet of the FAQs markup I created:

<script type=”application/ld+json”>

{

 “@context”: “https://schema.org”,

 “@type”: “FAQPage”,

 “mainEntity”: [{

   “@type”: “Question”,

   “name”: “What are the operating hours?”,

   “acceptedAnswer”: {

     “@type”: “Answer”,

     “text”: “WorkPlays operates from 9:00am to 7:00pm during weekdays. We are closed on weekends and public holidays.”

   }

 }, {

   “@type”: “Question”,

   “name”: “Is there a limit to the number of employees I can bring?”,

   “acceptedAnswer”: {

     “@type”: “Answer”,

     “text”: “Yes, if you are renting the space as a group, you can only have up to 5 members in one room. This ensures everyone can work comfortably while making the most of the available resources.”

   }

 }

</script>

Add the Markup to Your Website

This part can be the most challenging. It is wise to hand the code to your web developer and let them handle it. A mistake here could disrupt your website.

If you must do it yourself, ensure you have FTP (File Transfer Protocol) access to your website. Copy the code and paste it into the page’s header. The HTML element should be visible on the page.

Test Codes for Validation and Errors

Once you finish editing your structured data markup, test it with Google’s tools to see if it’s valid and check for errors. Google provides two tools for this purpose: the Structured Data Testing Tool and the Rich Results Test. I prefer using both.

These tools let you check for errors, but the Structured Data Testing Tool is easier for making quick edits to your code. The Rich Results Test allows you to preview how your page would appear in search results.

The Structured Data Testing Tool also detects various schema types, while the Rich Results Test focuses only on structured data eligible for rich results.

How to Use the Structured Data Testing Tool

First, go to the testing tool. You can either pull in the HTML code of a page automatically or manually copy and paste the code.

How to Create Structured Data Markup for Rich Snippets

If you have already applied the code, just paste the URL and click run test. If not, you might want to test in the Code Snippet Option first to avoid needing to reapply it later if there are errors.

After clicking on Run Test, you will see your code in the left panel for quick edits, while the right panel shows the valid structured data type along with any errors and warnings.

If there are errors in your code, such as missing commas or other elements, the tool will point out the precise line on the left panel.

How to Create Structured Data Markup for Rich Snippets

How to Use the Rich Snippet Test

How to Create Structured Data Markup for Rich Snippets

Visit the Rich Snippet Test tool. Similar to the Structured Data Testing Tool, you can fetch the code of an existing page with structured data or manually input your code.

When manually inputting the structured data code, I recommend also adding HTML for the Page Title and including URLs for any images. This allows you to preview how your page would look in search results.

How to Create Structured Data Markup for Rich Snippets

To see a preview of how your code will appear as a rich snippet, click “Preview Search Result.” Currently, the Rich Snippet Test is in Beta, and some structured data markups might not be supported yet. The displayed preview is also in a mobile format.

How to Create Structured Data Markup for Rich Snippets

Resubmit Your URL for Re-indexing

After applying the code to your page, inform Google about the changes. Use the URL inspection tool in Google Search Console to inspect the URL of the updated page and click ‘Request Indexing.’

How to Create Structured Data Markup for Rich Snippets

It doesn’t take long for changes to be reflected. Within 24 hours, you will likely see updates in search results, and the FAQ pages you created should now appear as Rich Results.

Key Takeaway

Writing and implementing structured data markup for rich snippets requires time and attention to detail, but there are no significant downsides. Whether or not Google ultimately makes structured data a ranking factor, making your website eligible for rich snippets will provide various benefits.
















    This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.