Home / Fix guides / Structured data and AI search

How to add schema markup to my website

Schema markup is a small block of code, usually JSON-LD, that tells search engines what your pages are about. To add it, use your platform's built-in setting or a trusted plugin where one exists, or paste a JSON-LD script into your page template, then test it with Google's free Rich Results Test.

Schema markup is code on your pages that tells search engines and AI tools, in a shared vocabulary, what a page is about: a business, a product, an article, an event. If your site has none, nothing looks broken. Visitors see the same page as before. Machines simply have to guess.

What the problem is

Schema markup uses the vocabulary from schema.org. The most common format is JSON-LD, a small script placed in the page that looks like this:

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "LocalBusiness",
  "name": "Example Bakery",
  "telephone": "+1-555-0100",
  "url": "https://www.example.com/"
}
</script>

Visitors never see it. People usually notice the gap when a competitor shows star ratings, prices or opening hours in Google and they do not, or when an SEO checker reports "no structured data found".

Why it matters

Schema does not directly raise your ranking, and Google does not promise anything in return for adding it. What it does is remove guesswork.

  • Rich results: for some types, such as products, reviews, events and recipes, correct markup makes a page eligible for extra details in search results. Eligible does not mean guaranteed. Google also limits some types: FAQ rich results, for example, are now shown only for a small set of authoritative sites.
  • Clear identity: your business name, logo, address, phone number and social profiles are stated as facts instead of being pulled out of page text.
  • AI search and assistants: tools that summarise the web can read clean, labelled facts more reliably than a paragraph of marketing copy. This can help, but no one can promise how a particular tool will use it.
  • Trust and sales: a product shown with the right price and availability, or a business with the right opening hours, sets correct expectations before anyone clicks.

How to check if your site has it

All of these are free.

  1. Open a page on your site, right click and choose View page source. Search (Ctrl+F or Cmd+F) for ld+json. If you find it, you have JSON-LD. Also search for itemtype, which points to an older format called microdata.
  2. Paste your page address into Google's Rich Results Test. It loads the page the way Google does, so it also finds markup added by JavaScript.
  3. Use the Schema Markup Validator at validator.schema.org to see every type found, even ones Google does not use for rich results.
  4. If your site is verified in Google Search Console, look under Enhancements (or the Shopping section) for reports on products, breadcrumbs and similar types.

Test more than the home page. Check a product page, a blog post and your contact page, because they need different types. SiteMonday checks structured data in week 16 and lists what is missing, ranked by importance.

How to fix it in general

The steps are the same on every platform.

  1. Decide which types fit your pages (see the table below). Start with a few.
  2. Create the markup. A plugin, app or built-in setting generates it for you, or you write the JSON-LD by hand.
  3. Place it in the page, in the <head> or anywhere in the <body>. Google accepts both.
  4. Make sure every value matches what visitors can see on the page. Markup that describes things not on the page can lead to a manual action from Google.
  5. Test it, then publish.
PageUsual schema type
Home or AboutOrganization or LocalBusiness, WebSite
Blog postArticle or BlogPosting
Product pageProduct with Offer (price, currency, availability)
Any inner pageBreadcrumbList
Event pageEvent

Common platforms

Menu names change between versions and themes, so treat these as pointers.

  • WordPress: SEO plugins such as Yoast SEO, Rank Math and All in One SEO output Organization, Article and breadcrumb markup once their setup wizard is complete. Look for a Schema or Search Appearance section in the plugin. See the WordPress guide.
  • Shopify: many themes already output Product markup, but some leave out fields or output it twice. Check with the Rich Results Test, and edit the theme's product template if needed (duplicate the theme or back it up first, so you can undo a mistake). See the Shopify guide.
  • Wix, Squarespace, Webflow: each adds some markup automatically. For more, look in the page's SEO settings for a structured data option, or paste JSON-LD into a custom code area for the page or site.
  • Next.js and custom sites: render a script tag with type="application/ld+json" in the page template, filled from the same data as the visible page.
  • Google Tag Manager: a Custom HTML tag containing your JSON-LD works, but markup injected this way depends on JavaScript, so confirm the Rich Results Test sees it.

If the test later reports syntax problems, see invalid JSON-LD.

How to confirm the fix worked

  • Run the Rich Results Test on each page type. You should see the types you added, with no red errors. Warnings about optional fields are normal.
  • Run the Schema Markup Validator on the same pages as a second opinion.
  • View the page source again and check there is only one block per type. Duplicates from a theme and a plugin are common.
  • In Search Console, use Request indexing for key pages. Reports under Enhancements can take days or weeks to fill in, so do not expect instant results.

Rich results may never appear for your site even when everything is correct. Google decides case by case.

How to stop it coming back

  • Keep one source of markup. Pick either your theme, one plugin or custom code, and switch the others off.
  • Retest after a theme change, a plugin update or a redesign. These are the usual moments when markup disappears.
  • Update the markup when business details change: phone number, address, opening hours, prices.
  • Test page templates, not only single pages, so one check covers every product or post.
  • A yearly or scheduled re-check catches silent breakage. SiteMonday's structured data week does this for you each year.

Step by step for your platform

Questions

Does schema markup improve my Google ranking?

Not directly. It helps search engines understand your content and can make a page eligible for rich results, which may improve how often people click.

Do I need a developer to add schema markup?

Often not. Most platforms and SEO plugins can output the common types from a settings screen, and a developer is only needed for custom types or unusual templates.

Should I use JSON-LD or microdata?

Use JSON-LD. Google recommends it, and it sits in one block of code separate from your page design, which makes it easier to edit and test.

Which schema type should I add first?

Organization or LocalBusiness on your home page, since it states who you are. Then add Product for shops or Article for blogs, plus breadcrumbs.

Is there a penalty for wrong schema markup?

Errors usually just stop rich results from showing. Markup that describes things not on the page, such as fake reviews, can lead to a manual action.

How long until I see results after adding schema?

Google must recrawl your pages first, which can take days or weeks. The Rich Results Test shows whether the markup is valid straight away.

Related problems