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": "https://schema.org", "@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": "https://schema.org/InStock", "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 & Structured Data for WP & 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 SEO ā†’ Settings ā†’ Content 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