|

How to Add Schema Markup to Your Website (Step-by-Step)

Warning: fileperms(): stat failed for /www/.wordpress/ in /wordpress/wp-admin/includes/file.php on line 2225

Warning: fileperms(): stat failed for /www/.wordpress/ in /wordpress/wp-admin/includes/file.php on line 2225

Once you know what schema markup is and why it matters (covered in Part 1), the obvious next question is how to actually add it. The good news: for most Australian businesses, schema is far less scary than it looks. The bad news: a lot of plugins, builders and guides bake in bad habits that cost you rich results and AI citations.

After implementing schema across dozens of WordPress and Shopify sites, the same patterns keep coming up. Most schema problems come from auto-generated plugin markup that doesn’t match the page content, or DIY attempts that miss the required fields. This guide is the step-by-step process I use to add schema markup correctly the first time and validate it before it ships.

This is a practical walk-through of how to add schema markup to your website properly, whether you run on WordPress, Shopify, or hand-coded HTML. We will cover the format you should use (JSON-LD), how to write or generate the code, where it goes, how to validate it, and the mistakes that quietly break it.

Before You Start: What You Need

Before touching any code or plugin settings, get three things sorted:

  • Know which pages need which schema. The home page typically needs Organization (or LocalBusiness for service businesses). Product pages need Product. Blog posts need Article or BlogPosting. Service pages need Service. FAQ blocks need FAQPage. A short audit of your site map is the cheapest insurance against wasted work.
  • Confirm the visible content matches the markup. Schema must describe what is actually on the page. Never mark up a star rating that does not appear on the page, an FAQ that no user can read, or a price that is not displayed. Google’s policy is clear and AI tools follow the same logic: if the user cannot see it, do not claim it.
  • Choose an implementation method. Plugin (Yoast, Rank Math, Schema Pro), built-in (Shopify), Google Tag Manager, or hand-coded JSON-LD. We compare these below.

JSON-LD Is the Only Format You Should Use

Schema can technically be written in three formats: JSON-LD, microdata or RDFa. In 2026, JSON-LD is the only sensible choice. It is the format Google explicitly recommends, the format every reputable plugin outputs, and the format AI search engines parse cleanest. It is a small block of JavaScript Object Notation placed inside a <script type=”application/ld+json”> tag in your page’s HTML.

Two big advantages: JSON-LD lives separately from your visible HTML, so it does not interfere with your design or content edits; and it is easy to read, edit and validate at a glance. A minimal Organization JSON-LD block looks like this:

<script type=”application/ld+json”>{ “@context”: “https://schema.org”, “@type”: “Organization”, “name”: “Rank Haus”, “url”: “https://rankhaus.au”, “logo”: “https://rankhaus.au/logo.png”, “sameAs”: [ “https://www.linkedin.com/in/coralee-roberts-81024b79/”, “https://www.instagram.com/rankhaus.au/” ]}</script>

Plain-text JSON-LD example. In production, place this in your <head> or just before </body>.

Step-by-Step: How to Write Schema Markup

Step 1. Identify the page type

Decide what the page is, not what you want it to be. A home page is an Organization or LocalBusiness page. A product page is a Product page. A service landing page is a Service or LocalBusiness page. A blog post is an Article or BlogPosting. Each page gets one primary schema type plus, where relevant, supporting types (BreadcrumbList, FAQPage, Review).

Step 2. Pick the right schema type and properties

Open Schema.org and search the type you need (for example, Product, LocalBusiness, Article). Each type has a list of properties (name, image, address, author and so on). Fill out as many as genuinely apply. Google also publishes structured data documentation telling you which properties are required, recommended and ignored for each rich result.

Step 3. Generate or hand-write the JSON-LD

For most pages, a schema generator is faster and safer than hand-writing JSON-LD. Three reliable options:

Google’s Structured Data Markup Helper. Visual point-and-click, good for beginners but limited to a small set of types.

Merkle’s Schema Markup Generator. Fast, covers most common types, and outputs clean JSON-LD.

Schema App’s Schema Generator. More advanced, handles nested entities and multiple types per page.

For complex nested schema (a service business that is also a person with multiple credentials and review aggregates), hand-editing is usually cleaner. JSON is easy to learn: braces, commas, quotes.

Step 4. Add the JSON-LD to your page

JSON-LD goes inside a <script type=”application/ld+json”> tag, usually in the <head> or just before </body>. Where you place it depends on your CMS:

  • WordPress: via a plugin (Yoast, Rank Math, Schema Pro), via theme code, or via Google Tag Manager.
  • Shopify: via the theme’s product.liquid or section files, via apps, or via Google Tag Manager.
  • Static HTML or custom builds: drop the script tag directly into the page template.

Step 5. Validate everything before you ship it

Never publish schema you have not validated. We cover the tools below.

How to Add Schema Markup in WordPress

WordPress has more schema options than any other platform. The good news is that most are reliable. The risk is doubling up: if two plugins output Organization schema, Google sees two competing entities and may ignore both. Pick one, configure it properly and disable schema in the others.

Yoast SEO

Yoast outputs an integrated graph (Organization, WebSite, WebPage, Article and BreadcrumbList) automatically. The setup is in Yoast > Settings > Site basics. Fill in your organisation name, logo and social profiles properly. For most editorial sites and service businesses, Yoast covers the basics out of the box.

Rank Math

Rank Math gives finer control. It supports a wider catalogue of schema types (Service, Product, FAQ, HowTo, Job, Recipe, Event, Course, Local Business) and lets you set defaults per post type. Better for sites that need varied schema across product, service and content pages.

Schema Pro

A dedicated schema plugin (separate from your main SEO plugin). Useful if you want to map specific properties to ACF fields, custom fields or CPTs. Overkill for a basic site.

Manual via theme or GTM

If you need fine-grained control, you can add schema via your theme’s header.php or a Google Tag Manager Custom HTML tag. GTM is the easiest way to fix or add schema without touching theme files, and it lets a marketing team manage it without developer involvement.

How to Add Schema Markup in Shopify

Shopify outputs basic Product, Organization, BreadcrumbList and WebSite schema by default in most modern themes. The default is usually thin: missing review aggregates, missing GTIN/MPN, inconsistent priceCurrency. Treat the built-in schema as a starting point, not the finished job.

Audit the built-in schema first

Run a product page and the home page through Google’s Rich Results Test. Note what is present, what is missing and what has warnings. Common gaps: missing aggregateRating, missing brand, missing GTIN, missing availability or currency on variant prices.

Extend with apps

JSON-LD for SEO, Schema Plus and SearchPie all add or rewrite schema across products, collections, blogs and FAQs. Pick one and use it consistently. As with WordPress, do not double up.

Custom Liquid for cleaner control

For larger Shopify stores, the cleanest fix is custom Liquid in theme.liquid (or in product.liquid for product-specific schema). It avoids app conflicts, gives you full control over which properties are output, and renders server-side which is friendlier for both Google and AI crawlers.

We do this as part of our ecommerce SEO service for Shopify clients (we do not build on WooCommerce). The biggest CTR wins on Shopify almost always come from product schema done right.

How to Validate Your Schema

Two tools. Use both. Always.

1. Google’s Rich Results Test checks whether the page is eligible for specific rich result types (FAQ, Product, Article, Review, Breadcrumb, etc.) and surfaces errors and warnings. This is the test that tells you whether Google will actually display rich features.

2. Schema.org Validator parses all schema on the page (not just Google-eligible types), validates the syntax and tells you which properties are missing or malformed. Useful for catching schema that is valid but will not produce a rich result, and for picking up errors on schema types Google does not yet support.

Once your schema is live, check Search Console’s Rich Results report regularly. It surfaces validation failures at scale, across every page Google has crawled, and flags new errors as they appear.

Common Schema Mistakes to Avoid

  • Marking up content that is not on the page. If users cannot see the rating, review, FAQ or price, do not put it in schema. Google calls this spam and will demote the page.
  • Doubling up Organization schema. Two plugins outputting Organization on the same page confuses Google. Pick one source and disable the other.
  • Fake FAQ schema. Inventing Q&A that is not on the page (or burying it behind accordions that AI tools cannot parse) is a wasted effort at best, a penalty risk at worst.
  • Missing required properties. Product without price, Article without author, LocalBusiness without address. Required fields are required for a reason.
  • Static placeholder data. Schema with ‘Your Company Name’ or ‘example@email.com’ still live in the source. Yes, we have seen this. Yes, on real sites.
  • Old microdata mixed with new JSON-LD. If your old theme still outputs microdata and your new plugin outputs JSON-LD, you may be sending conflicting data. Audit and standardise.
  • Not validating after changes. Plugin updates, theme updates and Shopify app updates can silently break schema. Re-run the Rich Results Test after any major change.

Schema Is Just the Start of AI Search Optimisation

Adding schema correctly makes your site easier for both Google and AI search engines to read. But schema is only one piece of the AI search puzzle. Getting cited in Google AI Overviews, ChatGPT, Perplexity and Gemini also takes entity building, authoritative content and credible third-party signals.

Part 3 of this series, schema markup for AI search and GEO, goes deep on that side. If you have not read it yet, Part 1 (what is schema markup) covers the fundamentals. And if you would rather have schema implemented as part of a broader AI search strategy, our AI SEO and GEO service builds schema as the foundation of a citation-focused playbook.

Google’s Search Gallery is the official catalogue of schema types Google supports for rich results. Each entry includes a worked JSON-LD example you can copy and adapt. Going to a generator first is fine, but cross-checking your output against the Search Gallery example confirms you’ve covered the required fields Google specifically extracts.

The most-used Search Gallery entries: Article, Product, Breadcrumb, FAQ, HowTo, LocalBusiness, Recipe, Review, Video. Each one has a “Required” and “Recommended” properties list. Missing a Required field = no rich result. Skipping Recommended fields = rich result, but less detail.

Customising a Template (The Actual Workflow)

Most schema deployments start by copying a template, but the customisation step is where most errors creep in. The reliable workflow:

  1. Copy the template into a code editor (VS Code, Notepad++, anything with JSON syntax highlighting)
  2. Replace every placeholder value with your real data, line by line
  3. Delete any properties you don’t have data for (better to omit a field than fake it with placeholder text)
  4. Verify the @context and @type lines at the top are correct for the schema you’re using
  5. Validate the JSON syntax in a JSON linter (any rogue comma or unescaped quote breaks the whole block)
  6. Paste the final code into your page or template
  7. Re-validate live in Google’s Rich Results Test

Adding Schema via Google Tag Manager

If you don’t have developer access to your theme files, Google Tag Manager (GTM) is a clean way to inject schema markup site-wide or page-specific. The workflow:

  1. In GTM, create a new Custom HTML tag
  2. Paste your full JSON-LD block, wrapped in <script type="application/ld+json">...</script>
  3. Set a trigger (All Pages, specific URLs, or page type conditions)
  4. Preview in GTM’s debug mode, validate the live URL in Rich Results Test, then publish the GTM workspace

Caveats: GTM-injected schema loads after the page renders. Google does process it eventually (the crawler runs JavaScript), but it’s slightly less reliable than schema embedded directly in the HTML. For high-value pages (product pages, key landing pages), embed schema in the template directly. For broad-coverage schema (Organization, BreadcrumbList), GTM is fine.

Validation Before AND After Publishing

Two-stage validation catches different errors:

  • Pre-publish validation using Schema.org Validator: catches JSON syntax errors, invalid property names, type mismatches. Paste your raw code, get instant feedback.
  • Post-publish validation using Google’s Rich Results Test: confirms Google can crawl, parse, and extract the schema correctly. Paste your live URL and Google fetches the rendered page.

You need both. Pre-publish catches developer errors; post-publish catches rendering and CMS errors (a template might strip your script tag, a JavaScript framework might delay schema loading past Google’s crawl budget, a plugin might inject conflicting schema).

Common Errors and Troubleshooting

The errors I see most often when auditing Shopify and WordPress schema:

  • Missing required fields. Product schema without offers, Article schema without headline, Organization without name. Rich Results Test flags these as red errors.
  • Invalid date formats. ISO 8601 only (e.g. 2026-06-23T10:00:00+10:00). “23 June 2026” or “6/23/2026” doesn’t parse.
  • String values where objects are expected. "author": "Coralee Roberts" works less well than "author": {"@type": "Person", "name": "Coralee Roberts"}. Use the object form for entities.
  • Duplicate or conflicting schema. A theme outputs Article schema, an SEO plugin outputs Article schema, and an analytics tag outputs Article schema, all on the same page. Google picks one, often the wrong one.
  • Schema for content not visible on the page. Don’t FAQ-schema questions and answers that don’t appear visually for users. Google has cracked down on this and treats it as spammy.
  • Variant URL canonical issues. Shopify product variants (?variant=12345) can emit schema with the wrong canonical, causing duplicate-rich-result issues.

A Maintenance Schedule

Schema isn’t fire-and-forget. Set a recurring schedule:

  • Weekly: check the Rich Results report in Google Search Console for new errors or warnings
  • Monthly: spot-check 5-10 product pages and 5-10 blog posts for schema completeness
  • Quarterly: audit Organization, LocalBusiness, and Person schema for accuracy (hours, address, sameAs links, current role)
  • Whenever you launch new content types: add appropriate schema and validate before publishing
  • After any theme update or plugin change: spot-check for regression (theme updates often break or replace schema)

Schema Generators and Tools by Platform

If you’d rather use a generator than write JSON-LD by hand:

Frequently Asked Questions

What is a schema markup example?

A common example is FAQPage schema: a block of JSON-LD listing each question and answer on a page. Search engines can use it to display drop-down FAQs in search results, and AI tools can quote the answers directly. Other common examples are Product (for ecommerce), LocalBusiness (for service businesses) and Article (for blog posts).

How do I add schema markup to HTML?

Add a <script type=”application/ld+json”> tag inside the <head> or just before the closing </body> of your HTML. Inside the script tag, paste your JSON-LD. Save, deploy and validate the page with Google’s Rich Results Test. JSON-LD is preferred over microdata or RDFa because it is cleaner and easier to maintain.

Is schema markup still relevant?

Yes, and arguably more relevant in 2026 than ever. AI search engines depend on structured data to extract facts cleanly and choose who to cite. Even where it is not a direct ranking factor, schema improves click-through rate, eligibility for rich results and AI visibility.

Should I use a schema plugin or hand-code it?

For most sites, a plugin (or built-in Shopify schema, extended carefully) is the right choice. Plugins handle updates and integrations cleanly. Hand-coded JSON-LD is best for unusual schema types, custom data structures, or sites where you need precise control. Google Tag Manager is a strong middle ground.

How do I check if my schema markup is working?

Run the page through Google’s Rich Results Test and Schema.org Validator. Then check Search Console’s Rich Results report after a week or two to see whether Google has detected and accepted the schema across your site. Re-test after any plugin, theme or content change.

Can I add schema markup to WordPress without a plugin?

Yes. You can add JSON-LD directly via your theme’s header.php, via a custom function in functions.php, or via a Google Tag Manager Custom HTML tag. GTM is the cleanest option for non-developers because it does not require touching theme files and is easy to update.

Want Schema Done Properly Across Your Site?

Schema is one of the highest-leverage technical SEO fixes available. It improves clicks, eligibility for rich results and AI search citations, and it is often the single biggest quick win we find when we run a site audit.

Rank Haus implements schema as part of our technical SEO service. We audit what is already there, design the right schema graph for your business, implement it cleanly across your site, and validate it. Book a discovery call or see our SEO audit and strategy service for the broader picture.

Continue the series: Part 1: What is schema markup | Part 3: Schema markup for AI search and GEO

Our Services

Similar Posts