How to Add Structured Data for Better Search Results

If you've ever seen a search result with star ratings, a recipe photo, or an FAQ dropdown, you've seen structured data in action. Also known as schema markup, structured data helps search engines understand your content better and can make your listings stand out with rich snippets. This guide shows you how to add it to your site, even if you're not a developer.

What Is Structured Data?

Structured data is code added to your web pages that tells search engines exactly what your content means. For example, instead of guessing that "$19.99" is a price, structured data explicitly marks it as a price. This can lead to rich results like product prices, review stars, event dates, or recipe times in search listings.

Why It Matters for SEO

While structured data isn't a direct ranking factor, it can improve your click-through rate (CTR) by making your result more attractive. Higher CTR often leads to more traffic. Plus, Google uses structured data for features like Knowledge Panels and voice search answers.

Choosing the Right Schema Type

Start by identifying the most relevant schema type for your page. Common types include:

You can find the full list at Schema.org.

How to Add Structured Data

There are three main formats: JSON-LD (recommended), Microdata, and RDFa. JSON-LD is Google's preferred format because it's easy to implement and maintain.

Step 1: Create Your JSON-LD Markup

Write the JSON-LD by hand — it's a small block of key-value pairs — or let your CMS generate it. A reliable approach:

  1. Pick the right schema type for the page from Schema.org.
  2. Start from a matching example in Google's structured data documentation.
  3. Fill in your page's real values (headline, author, date, price, etc.), keeping them consistent with what's visible on the page.

If you're on a CMS, an SEO plugin like Yoast or Rank Math can output valid JSON-LD for common types automatically.

Step 2: Add the Code to Your Page

For JSON-LD, insert the code inside the <head> or <body> of your HTML. On WordPress, you can use a plugin like Yoast SEO or Rank Math, which have built-in schema features. For other platforms, add it via your theme's header file or a tag manager.

Step 3: Test Your Markup

Before publishing, test your structured data with Google's Rich Results Test. Enter your URL or paste the code to see if it's valid and what rich results it can generate. Fix any errors or warnings.

Common Structured Data Examples

Article Schema

{
  "@context": "https://schema.org",
  "@type": "Article",
  "headline": "How to Add Structured Data",
  "author": {
    "@type": "Person",
    "name": "Jane Doe"
  },
  "datePublished": "2024-06-01"
}

Product Schema

{
  "@context": "https://schema.org",
  "@type": "Product",
  "name": "Wireless Headphones",
  "offers": {
    "@type": "Offer",
    "price": "79.99",
    "priceCurrency": "USD"
  }
}

FAQ Schema

{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "mainEntity": [{
    "@type": "Question",
    "name": "What is structured data?",
    "acceptedAnswer": {
      "@type": "Answer",
      "text": "Structured data is code that helps search engines understand your content."
    }
  }]
}

Best Practices

Next Steps

Adding structured data is a powerful way to make your search listings more compelling. Start with one page type, test it, and then expand to others. To see how your current pages are performing, run a free audit of your site. It will highlight opportunities to improve your search presence, including structured data gaps.

For more guides on technical SEO and site optimization, check out our guides library.

More guides · Compare audit tools · Run a free website audit