What schema markup does and why it matters for search results
Schema markup is code you add to your website that tells search engines what your content actually is — whether a page describes a recipe, a product, a business location, or an event. Without it, Google and other search engines have to guess. With it, they can show richer information in search results: star ratings for recipes, prices for products, opening hours for businesses.
The markup itself doesn't change how your page looks to visitors. It's invisible HTML that sits in the background. But it changes what search engines can do with your content. A recipe page with schema markup might show a photo, cook time, and calorie count right in the search result. The same page without markup shows only a title and description.
Schema markup won't directly boost your ranking in search results. Google has said this clearly. But it can increase click-through rates because richer results attract more attention, and it helps search engines categorize your content correctly — which matters for visibility in the right searches.
Key Takeaways
- Schema markup uses a standard language called JSON-LD that you paste into your website's HTML, usually in the head section or near the content it describes.
- Different types of content need different schema types: Article, Product, Recipe, LocalBusiness, Event, and others — you choose based on what your page is about.
- Google's Rich Results Test tool shows you whether your markup is correct and what rich features it will enable in search results.
- You can add schema markup manually by editing HTML, through plugins if you use WordPress, or through tools that generate the code for you.
- Schema markup is optional but increasingly common on competitive pages, so adding it puts you on equal footing with similar sites in your industry.
Understanding the schema markup standard and where it goes on your site
Schema markup follows a standard called JSON-LD (JavaScript Object Notation for Linked Data). It's the format Google recommends, and it looks like a block of code wrapped in <script> tags. You don't need to understand how to write it from scratch — tools generate it for you — but you do need to know where it goes and what it describes.
The code typically lives in one of two places: in the <head> section of your HTML (the invisible part of the page), or right before the closing </body> tag. Either location works. If you use WordPress, plugins like Yoast SEO or Rank Math insert it automatically. If you edit HTML directly, you paste it into your page's source code.
Each piece of schema markup describes one thing on your page. A product page might have schema for the product itself, plus separate schema for the business selling it. A blog post might have schema describing the article, the author, and the publication date. You can have multiple schema blocks on one page, and they don't interfere with each other.
The most common schema types and when to use each one
Google supports dozens of schema types, but most websites use a handful. Article schema describes blog posts, news stories, and long-form content — it includes headline, author, publication date, and image. Product schema describes items for sale and includes price, availability, and customer reviews. Recipe schema is for cooking instructions and includes ingredients, cook time, and nutrition facts.
LocalBusiness schema describes a physical location — a restaurant, store, or office — and includes address, phone number, opening hours, and reviews. Event schema describes concerts, conferences, or classes and includes date, location, and ticket information. Organization schema describes your company as a whole and includes logo, contact details, and social media links.
To choose the right type, ask what your page is primarily about. A blog post is Article. A product listing is Product. A restaurant page is LocalBusiness. If your page is about multiple things, you can use multiple schema types, but focus on the main one first. Most websites start with Article or Product because those are the most common.
How to add schema markup if you use WordPress
If your site runs on WordPress, the easiest route is a plugin. Yoast SEO and Rank Math are the most widely used. Both have free versions that handle schema markup automatically. Install the plugin, activate it, and go to the page you want to add schema to. The plugin shows a settings panel where you choose the content type (Article, Product, LocalBusiness, and so on) and fill in the details.
Yoast's interface asks you for the headline, description, featured image, and publication date — it pulls some of this from your post automatically. Rank Math works similarly but with a slightly different layout. Both plugins generate the JSON-LD code in the background; you never see the raw code unless you want to.
If you prefer not to use a plugin, you can add schema markup manually by editing your theme's template files or using a custom code plugin like Code Snippets. This requires more technical knowledge, so it's worth trying a plugin first. Most WordPress users find that Yoast or Rank Math handles their needs without extra work.
How to add schema markup if you edit HTML directly
If you manage your site's code directly — whether it's a custom-built site, a static site generator, or a platform that lets you edit HTML — you'll add schema markup by hand. Start with Google's Schema Markup Generator or Schema.org's documentation. The generator walks you through your content type and builds the JSON-LD code for you. You copy the code block it produces and paste it into your HTML.
The code goes inside a <script type="application/ld+json"> tag. Here's the structure: the opening tag, then the JSON-LD code, then the closing </script> tag. Paste this block into your page's HTML — usually in the <head> section or just before </body>. The placement doesn't affect how it works, so choose whichever is easier for your workflow.
After you paste the code, test it with Google's Rich Results Test. Paste your page URL into the tool, and it shows you whether the markup is valid and what rich features it enables. If there are errors, the tool points them out. Fix any errors, re-test, and you're done.
Testing your schema markup and fixing common errors
Google's Rich Results Test is the standard tool for checking schema markup. Go to search.google.com/test/rich-results, paste your page URL, and click Test. The tool crawls your page, reads the schema markup, and tells you whether it's valid. If it is, it shows you what rich features will appear in search results — star ratings, prices, images, whatever applies to your schema type.
Common errors include missing required fields (like price for a Product), incorrect data types (like putting text where a number is expected), or typos in field names. The test tool points out each error and explains what's wrong. Most errors are easy to fix: you either add the missing field or correct the format.
After you fix errors and re-test, the tool should show a green checkmark and a preview of how your rich result will look. This preview is what users see in Google search results — it's worth checking that it looks right. If the preview is missing information you expected, you may need to add more fields to your schema markup.
Tools that generate schema markup for you
If you don't want to write or paste code, several tools generate schema markup from a form. Google's Schema Markup Generator is free and straightforward — you choose your content type, fill in the details, and it builds the JSON-LD code. Merkle's Structured Data Markup Helper works similarly. Both are web-based, so you don't install anything.
Some SEO platforms like SEMrush and Ahrefs include schema markup generators as part of their paid tools. These are useful if you're already paying for SEO software, but they're not necessary for basic schema markup. For most websites, Google's free generator or a WordPress plugin is enough.
After a tool generates your code, you still need to test it with Google's Rich Results Test before you publish it. This catches any mistakes the tool made or any fields you missed. Testing takes two minutes and saves you from publishing broken markup.
Frequently Asked Questions
Does schema markup help my website rank higher in Google?
Schema markup doesn't directly boost your ranking. Google has said it doesn't use schema as a ranking factor. But it can increase click-through rates because rich results with images, ratings, and prices attract more clicks than plain text results. Higher click-through rates may indirectly help your ranking over time.
Can I add schema markup to pages I don't own or control?
No. Schema markup must be added to the HTML of your own website. You can't add it to other people's pages or to content you don't control. If you're a guest author on someone else's site, ask the site owner to add schema markup to your article.
What happens if my schema markup has errors?
Google ignores schema markup with errors. It won't show rich results, but it also won't penalize your page. The page ranks and displays normally — you just miss out on the richer search result appearance. That's why testing with Google's Rich Results Test is important: it catches errors before they go live.
Do I need different schema markup for mobile and desktop?
No. The same schema markup works for both. Google reads it the same way on mobile and desktop, and rich results appear on both. You don't need to create separate versions.
What if my page is about multiple things?
You can use multiple schema types on one page. A product page might have Product schema for the item and LocalBusiness schema for the seller. A blog post about an event might have Article schema and Event schema. Just make sure each schema block is separate and describes what it's supposed to describe.