A self-hosted site puts you in charge of the full stack: the templates, the build, the deployment, and the HTML the server sends. So adding product schema becomes a change to your own code, rather than a flip of a platform switch. You add a JSON-LD block to the product template so every product page renders it on the server, and it ships with your next deploy. The flip side is that you also own every failure mode. Nobody validates the markup for you, nobody keeps it in sync with price changes, and nobody stops a deploy from shipping broken JSON.
What makes a self-hosted site different
No guardrail exists, and no ceiling either. Unlike Shopify or Wix, no theme system fights you and no locked markup blocks you. Unlike Squarespace, no plan gate stands in the way. The product template is yours, the data layer is yours, and the rendered HTML is exactly what you emit, which means server rendered JSON-LD is guaranteed as long as you place it in the template rather than injecting it with client side JavaScript. The trade is responsibility. Markup comes from your code, so a template bug, a bad deploy, or a data field that renders on the page but never reaches the JSON-LD block is entirely on you. Most self-hosted schema failures come from data plumbing, not from syntax.
Work through it in this order
Check what the server really sends. This step counts more here than on any platform. Pull up a product page the way a crawler would, using curl or view-source, then hunt for application/ld+json. Do not trust the browser DOM. When your stack hydrates content with JavaScript, the DOM can display markup that never appeared in the first HTML. When the block is missing from the raw response, AI crawlers cannot see it.
Put the block in the product template. Place the JSON-LD script in the template or partial that renders your product pages, meaning the layout, the view, or the component, depending on your stack, guarded so it renders only on product routes. Draw each value from the same source that builds the visible page, whether that is the product record, the pricing service, or the stock check. A template that reads the price from one service for the page and a different service for the markup will disagree with itself sooner or later, and a price mismatch between markup and page is the most damaging schema failure there is.
Handle variants and stock status inside the template logic. When products carry variants, the template must send per variant offers with per variant stock status. When a product can sell out, the stock value must come from live inventory at render time, not baked in at build time, unless your build reruns on every inventory change.
Ship it, then check the raw HTML. Ship through your normal pipeline, then curl a staging or production product address and confirm the block sits in the response. Test a product address through Google's Rich Results Test and the Schema Markup Validator. Test with a variant page and a product that is out of stock.
Add validation to the pipeline. Since no platform checks this for you, add a check that survives deploys: a test that fetches product pages and asserts the JSON-LD parses and carries price, currency, and stock status, or at minimum a recurring manual validation pass after template changes. Redesigns most often break this by shifting the block, renaming a field, or removing the block altogether.
A team that caught a silent loss
Imagine a tea shop on a self-hosted stack built with a small team, Highline Tea Co. The team curls a product page and finds no JSON-LD at all. They add the block to the product view template, drawing name, price, and stock status from the same product record the page renders, and deploy. One month on, a redesign gives the template partial a new name and the block quietly vanishes. Their deploy check catches it because they added a test asserting every product page response holds a parseable Product block. That check separates a team in control of its stack from a team at the mercy of it.
Two companions worth adding
Once the markup is valid, two more pieces help AI tools use it. An llms.txt file gives tools a short plain summary of what your business sells and where the key pages sit. Open crawler permissions in robots.txt make sure AI crawlers can reach the pages carrying the markup at all. Aizii Learn covers both topics in full, in separate guides.
What this guide leaves out
This guide covers getting valid, server rendered markup onto self-hosted product pages. It does not cover keeping that markup fresh as inventory moves beyond the pipeline checks above, getting AI crawlers to your pages past your own edge and bot rules, or letting an AI tool finish a checkout, which is a separate transaction job.
Frequently Asked Questions
Where does the block go on a self-hosted site?
In the product template or partial that renders your product pages, guarded so it renders only on product routes. It ships with your next deploy.
Why can I not trust the browser DOM to check it?
Because when your stack hydrates content with JavaScript, the DOM can display markup that never appeared in the first HTML. Fetch the page with curl or view-source instead.
What is the most common self-hosted schema failure?
Data plumbing, not syntax. A template that reads the price from one service for the page and a different service for the markup will disagree with itself sooner or later, and a price mismatch is the most damaging schema failure there is.
How do I stop a redesign from silently dropping the block?
Add a check that survives deploys: a test that fetches product pages and asserts the JSON-LD parses and carries price, currency, and stock status, or at minimum a recurring manual validation pass after template changes.
Verified Sources & Technical Documentation
- Google Search Central, Product structured data Specific https://developers.google.com/search/docs/appearance/structured-data/product
- Schema.org, Product type General Docs https://schema.org/Product
links marked specific point to the page that supports the claim in this guide. Links marked general docs point to the vendor's general docs section for that topic, not to a page that proves every step. Check the vendor docs for the current path before relying on a menu name or click path in this guide.