Search

How to Display Rich Snippets for your WordPress Website

Listen to this article
rich-snippets-for-seo
Rich Snippets for SEO

Several digital marketing websites, and gurus talk about optimizing your content for search engines. And they will give you a ton of advice. My search engine optimization mantra – ‘give users what they are looking for’. This means, that if a user has landed on your page, with a combination of keywords, your page should contain the information he has been searching for. So if you’ve searched for ‘rich snippets wordpress’, and landed on this page, I have to give you a guide to displaying rich snippets for your WordPress website, and that is exactly what this article is about. And since Rich Snippets are related to SEO, we will be talking a bit about SEO as well.

[space]

Some Like It ‘Rich’

The reason why I started talking about search engine optimization, is because ‘Rich Snippets’ take you a step closer to optimizing your website for search engines. And some of you already know that. But for those of you who do not, let’s answer the basic question – what exactly are Rich Snippets?

Rich Snippets, a term used by Google, (Bing calls it Rich Content) refers to the content displayed below every search result, which provides additional information (such as price range, star rating, review count, etc) about the page, to a user. The image below will give you a better idea of what I am talking about:

rich-snippets-wordpress-page
An Example of Rich Snippets

These rich snippets are displayed by reading structured data added in a webpage.

The Perks of Rich Snippets

  • Rich Snippets benefit a user, by providing an overview about a page, and hence are valued by search engines. Which is great! Because it’s a simple way to improve your ranking.
  • Rich Snippets improve click-through rates. Also since users are more aware of what information to expect, they are bound to stay on your site longer.

And what kind of content are rich snippets? Well, you can display rich snippets for reviews, price, event details like location, date, or recipe information like calorie count, preparation time, and so on.

[space]

How It’s Done

So the next step of course, is to add structured data on your webpage, so as to allow Google to create this rich snippet. And the way forward? Is to speak the Search Engine Language. So here, you can use microdata, microformats, RDFa. These formats are understood by other search engines like Bing as well. And, if you know basic HTML, you should float safely through. Instead of deciding which format to go ahead with, I’ll make it simple- Google recommends, microdata. For now, let’s just focus on that.

Wear your Lab coats- Let’s experiment a bit.

So say you have a movie review website on WordPress, and want Google to show the rating, and reviewer name shown as a rich snippet (just like the image in the example above).

If you search for a movie review in Google, you’ll notice, rich snippets shown for several top movie review websites, like RottenTomatoes or IMDB. Just open a movie review page, and ‘View Page Source’. Search for meta properties, specifically, ‘itemprop’. This is microdata information, that is being read to display rich snippets.

So, what do you have to do to ensure such snippets are displayed for your movie review WordPress website?

An Example with WordPress

In your WordPress website, a review would usually be a custom post type. And this custom post type will have a corresponding template single-{cpt}.php using which the information is shown on a web page. Thus, this meta or microdata information has to be added in the single page template of your custom post type (or whichever template you the meta information to be placed).

In continuation with our example, the reviewer and rating information, can be added using the below code:

<meta itemprop="reviewer" content="<?php echo $wdm_reviewer_name; ?>">
<meta itemprop="rating" itemscope itemtype="http://data-vocabulary.org/Rating">
<meta itemprop="value" content="<?php echo $wdm_rating; ?>" />
<meta itemprop="best" content="5" />

Here, ‘wdm_reviewer_name’ and ‘wdm_rating’, are meta values part of your custom post type, which hold the reviewer name and rating information respectively.

To know which other properties you can add, read, ‘Webmaster Tools: Adding Markup Directly’. And to test out if it works? Use Google’s Structured Data Testing Tool. There are WordPress plugins available too, which you can use to add structured data. But understanding what happens behind the scene, gives you more control over the content being shown.

[space]

And there you have it. My crash course on rich snippets, and how you can show them for your WordPress website, using structured data. Rich snippets are also part of search engine guidelines, to help optimize your website for search engines. And to help me, make this article better, do leave your comments and questions, in the comment section below 😀

Akshaya Rane

Akshaya Rane

Leave a Reply

Your email address will not be published. Required fields are marked *

Get The Latest Updates

Subscribe to our Newsletter

A key to unlock the world of open-source. We promise not to spam your inbox.

Suggested Reads

Join our 55,000+ Subscribers

    The Wisdm Digest delivers all the latest news, and resources from the world of open-source businesses to your inbox.

    Suggested Reads