How to Use Rich Snippets in WordPress: Beginner’s Guide

How to Use Rich Snippets in WordPress: Beginner's Guide

👉 In this article, we’ll talk more about what rich snippets are and how you can use them. Then we’ll show you how to use rich snippets in WordPress. Let’s get to it!

What are rich snippets?

When you view a Search Engine Results Page (SERPs), you’ll notice several types of entries. A basic result includes a link to a page, a title, and a meta description:

A basic search result as we learn how to make rich snippets in WordPress.

Those types of results are the bread and butter of search engines. However, Google also includes several other types of entries. Rich snippets add extra elements to “base” results, such as images. For a recipe, you get components such as cooking time, number of reviews, and ratings.

An example of a rich snippet.An example of a rich snippet.

There are a lot of types of rich snippets, depending on what they showcase. It’s not only recipes. Search engines have rich snippets for books, reviews, posts, videos, and dozens of other types of content.

Book listings on Amazon, for instance, offer interesting tidbits like the book’s rating, the number of reviews, its current price, and if it’s in stock.

A rich snippet for a product.A rich snippet for a product.

Search engines don’t generate rich snippets automatically. You need to “tell” the search engine what kind of content it’s dealing with and provide the contextual information it needs for the snippet. That is possible thanks to schema markup.

An introduction to schema markup

Schema markup is a type of code you add to a page’s HTML. The markup gives search engines the information they need to generate rich snippets.

There are hundreds of types of schema for different content. The options at your disposal are microdata, RDFa, and JSON-LD. This enables you to choose the best type of markup depending on how you code your site.

To give you an example of how schema works, here’s the markup for a review page using JSON-LD, going inside script tags in the page’s header:

<script type="application/ld+json"> { "@context": "", "@type": "Product", "aggregateRating": { "@type": "AggregateRating", "ratingValue": "3.5", "reviewCount": "11" }, "description": "Big white fride. Very cool.", "name": "Kenmore White 17" Fridge", "image": "kenmore-fridge-17in.jpg", "offers": { "@type": "Offer", "availability": "", "price": "300.00", "priceCurrency": "USD" }, "review": [ { "@type": "Review", "author": "John", "datePublished": "2023-04-01", "reviewBody": "The fridge wasn't cool enough.", "name": "Uncool", "reviewRating": { "@type": "Rating", "bestRating": "5", "ratingValue": "2", "worstRating": "1" } </script>

Code language: HTML, XML (xml)

That code would translate to a rich snippet that looks like this:

A rich snippet in WordPress.A rich snippet in WordPress.

If this looks complicated, don’t worry. Even if you lack coding knowledge, it’s relatively easy to add schema markup to a WordPress site. You can find examples of the markup you need and add specific details for each page.

The alternative is to use a plugin that completes all the work for you. This is typically the best option, as it saves you from having to create rich snippets in WordPress for every page.

How to use rich snippets in WordPress (three steps)

Since adding schema markup manually can be incredibly time-consuming, we’re going to focus on how the process works with plugins. Let’s start by deciding which plugin to use.

Step 1: Choose a schema markup plugin 🔌

There are several plugins you can use to add rich snippets in WordPress. Some developers gear their plugins toward mainly helping you add schema markup. Others, such as Yoast SEO, do this as a bonus while assisting you with other aspects of SEO.

Since Yoast SEO is the most popular SEO plugin in the market, it’s the one we’ll show you how to use to add rich snippets in WordPress.

If you don’t want to use Yoast, other plugins we recommend include Rank Math (another popular SEO plugin) and Schema &amp; Structured Data for WP &amp; AMP. Once you settle on a plugin, move on to the next step.

Step 2: Configure the available schema options ⚙️

If you use Yoast SEO, you can configure a default type of schema for every post. By default, Yoast SEO will use the Web Page schema for pages and the Article schema for posts.

To change that configuration, go to Yoast SEOSettingsContent types. Select either Posts or Pages and look for the Schema section. Here you can change the default type of schema for either posts or pages.

Default schema types in Yoast for rich snippets in WordPress.Default schema types in Yoast for rich snippets in WordPress.

This configuration comes in handy if your website focuses on a specific type of content such as reviews, recipes, or tech articles (yes, that’s an option available in Yoast).

Note that Yoast SEO doesn’t include all the existing types of schema. It supports the most popular options. However, if you’re working with highly specific types of content, you may need to look for a plugin that focuses solely on that schema markup.

After changing the configuration, save the new settings. Now let’s add rich snippets in WordPress for individual pages or posts – instead of the global settings we just configured.

Step 3: Add schema markup to individual pages 👨‍💻

As you may know, Yoast gives you tips on how to optimize each page for search engines. If you take a look at the Yoast SEO widget below or next to the editor in WordPress, you’ll see a tab that says Schema.

The Schema tab enables you to specify what type of content you’re working on. This tells the plugin what rich snippets for WordPress it should generate.

The schema tab in Yoast SEO for making rich snippets in WordPress.The schema tab in Yoast SEO for making rich snippets in WordPress.

Note that the defaults you see here will be the same ones you configured during step two. If the content you’re working on matches that default, skip this step. Otherwise, select a page or article type and navigate the schema options Yoast offers:

  • Article
  • Blog Post
  • Social Media Posting
  • News Article
  • Advertiser Content Article
  • Satirical Article
  • Scholarly Article
  • Tech Article
  • Report
Configuring what type of schema to use for rich snippets in WordPress.Configuring what type of schema to use for rich snippets in WordPress.

The schema choices for pages differ from what’s available for posts:

  • Web Page
  • Item Page
  • About Page
  • FAQ Page
  • QA Page
  • Profile Page
  • Contact Page
  • Medical Web Page
  • Collection Page
  • Checkout Page
  • Real Estate Listing
  • Search Results Page
Available schema types.Available schema types.

When you’re done, save the changes to the page or post and that’s it. Once the content starts to rank in search engines, you’ll see it appear in the form of a rich snippet.

Our conclusion on implementing rich snippets in WordPress 🧐

Adding rich snippets in WordPress is simple, at least if you use plugins. Rich snippets require you to use schema markup. That means you need to add code to the header of each page you want to appear as a rich snippet.

👉 With the right plugin, you can skip adding schema markup manually. Here’s a recap of how the process works, step by step:

  1. Choose a schema markup plugin (we recommend Yoast SEO) 🔌
  2. Configure the available schema options ⚙️
  3. Add schema markup to individual pages 👨‍💻

Do you have questions about how to add rich snippets in WordPress? Let’s talk about them in the comments section below!

Keep reading the article at CodeinWP. The article was originally written by John Hughes on 2023-12-05 07:00:00.

The article was hand-picked and curated for you by the Editorial Team of WP Archives.

Disclosure: Some of the links in this post are "affiliate links." This means if you click on the link and purchase the product, We may receive an affiliate commission.

Leave a Comment

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

Show Your ❤️ Love! Like Us
Scroll to Top