How to Add Schema Markup to a Website
Schema markup is a small block of code that tells Google what your page is about in a language it understands precisely: this is an article, this is a product with a price, these are frequently asked questions. Pages with valid schema can earn rich results — star ratings, FAQ dropdowns, recipe cards — that take up more space in search results and get clicked more often. This guide shows you how to add it with JSON-LD, the format Google recommends.
What schema markup is (and what it is not)
Structured data in a shared vocabulary
Schema markup is structured data: extra information about your page, written in a shared vocabulary from schema.org that search engines understand. The most common way to add it is JSON-LD, a block of code inside a script tag that sits in your page but is invisible to visitors. Your readers never see it; Google reads it every time it crawls the page.
Not a ranking factor — rich results instead
It is worth being clear about what schema does not do. It is not a ranking factor — Google has said so plainly. Its value is rich results: when your markup is valid, Google may show your listing with stars, prices, FAQ dropdowns or other extras that take up more space and earn more clicks. Valid markup is a requirement for rich results, not a guarantee: Google decides when to show them, and it can take days or weeks after crawling.
The five schema types most sites should know
Article, FAQPage and the rest
Article covers blog posts and news pages, with a headline, author and publish date. FAQPage covers a visible list of questions and answers — and the answers in the markup must match the text on the page exactly, or Google can treat it as a violation. LocalBusiness carries a business name, address, opening hours and phone number. Product carries a price, availability and review summary. BreadcrumbList describes the navigation trail, which Google may show in place of the plain URL.
Several types on one page at once
One page can carry several types at once. A product page might have Product, BreadcrumbList and FAQPage together. Keep each block accurate to what the page actually contains, and either use a single script tag with a @graph array or separate script tags — both are valid.
Add schema markup in five steps
- Pick the type that matches your page. Match the real content: Article for a blog post, Product for a product page, FAQPage for a page with a visible FAQ section. Do not add Product schema to a blog post or FAQPage markup for questions that are not on the page — mismatched markup is a policy violation.
- Fill in the required fields. Each type has fields Google requires and fields it recommends. Use real values: the actual headline, the real price, the real publish date in YYYY-MM-DD format. Guessed or placeholder values are worse than no markup at all.
- Generate and copy the JSON-LD. The Schema Markup Generator builds the code from a form and checks the JSON syntax before showing it, so a missing comma cannot break your page. Copy the finished block, script tags included.
- Paste it into your page. The script tag goes inside the head section or just before the closing body tag — both work. On WordPress, use your SEO plugin's schema settings or a code-snippets plugin. On a static site, paste it directly into the HTML file.
- Test before you publish. Run the page URL, or the code itself, through Google's Rich Results Test. Fix every error it reports; warnings are less serious but worth fixing where you can. Re-test after any edit — a change to the page content may mean the markup no longer matches.
Common schema mistakes
The most common mistake is markup that does not match the visible page — FAQPage entries for questions that are not on the page, or ratings that no visitor can see. Google treats that as misleading structured data and can remove your rich results. Fake reviews and ratings are worse: they are against policy and can cost you the feature entirely.
Stale data is the quieter problem. A price that changed months ago, an event date that has passed, an article date that was never updated — all of them make your markup wrong, and Google notices. And if two plugins both add schema to the same page, you can end up with duplicate or conflicting blocks; pick one source and switch the other off.
Other ways to add schema
WordPress SEO plugins generate basic schema automatically — Article for posts, BreadcrumbList for navigation — and that covers most sites. Shopify themes include Product schema out of the box. For full control, hand-writing the JSON-LD is always an option, and the schema.org documentation lists every type and field.
The generator route suits static sites and one-off pages, where installing a plugin is overkill and hand-writing JSON by hand is error-prone. Either way, the Rich Results Test is the final step — never publish untested markup.
Related guides
- How to Check a Page for Basic SEO (Free Checklist) — a five-minute checklist before you publish a page.
- How to Create an XML Sitemap (Free, in Minutes) — list every page for search engines in an XML sitemap.
- How to Create a Robots.txt File (Free, in 2 Minutes) — tell search engines which pages to crawl and which to skip.
Questions people ask
What is JSON-LD?
JSON-LD is a way of writing structured data as a JavaScript block inside a script tag. It is the format Google recommends because it sits separately from your visible content, so it is easy to add without touching your page layout.
Does schema markup improve rankings?
Not directly. Google has said structured data is not a ranking factor. Its value is rich results: more visible listings that earn more clicks, which is still worth having.
Can I add more than one schema type to a page?
Yes. A product page can carry Product, BreadcrumbList and FAQPage at once. Keep each block accurate, and use a single script tag with a @graph array or separate script tags.
Why is my rich result not showing?
Valid markup is only the first step. Google decides when to show rich results, and it can take days or weeks after crawling. Check the page in the Rich Results Test and in Search Console under Enhancements.