Add Schema Markup to Shopify Without an App
Table of Contents
Shopify ships with basic Product schema in most themes, but it's incomplete. Most stores need to add or extend it — and you don't need a paid app to do it. Editing theme.liquid lets you paste in custom JSON-LD that augments or replaces the defaults. This guide walks through adding Product, LocalBusiness, FAQ, and Article schema without touching the App Store.
What Shopify Already Generates (And Why It's Not Enough)
Most Shopify themes include basic Product schema in their templates. For Dawn (the default Shopify theme), it covers: name, image, price, currency, availability, and SKU. That's the bare minimum required for Google to recognize the page as a product.
What's usually missing: brand, gtin, aggregateRating, description (often empty), proper offers structure for variants, and any review markup. These missing fields are what unlock star ratings, "in stock" badges, brand names in search results, and Google Shopping graph inclusion.
You have two options: extend the existing schema or replace it entirely. Replacing is cleaner; extending is safer if you don't want to risk breaking the default.
How to Edit theme.liquid (No Code Background Needed)
Don't be intimidated — Liquid is just a templating language with variables. You don't need to write code, just paste and substitute.
- From your Shopify admin, go to Online Store → Themes
- Find your active theme. Click Actions → Edit Code
- The code editor opens. On the left, navigate to Templates → product.liquid (or Sections → product-template.liquid in newer themes)
- Find a good place to paste your schema — typically near the top of the file, inside the main content area
- Use our free schema markup generator to build your starting JSON-LD
- Replace the static values in the JSON with Liquid variables (see next section)
- Click Save
Test on a live product page after saving. View source and search for "application/ld+json" — your schema should be there with real product data filled in.
Replacing Static Values with Liquid Variables
The generator outputs JSON with placeholder values. To make it dynamic, replace those values with Liquid variables. Here are the most useful ones for product schema:
- Product name: {{ product.title | escape }}
- Description: {{ product.description | strip_html | escape }}
- SKU: {{ product.selected_or_first_available_variant.sku }}
- Brand: {{ product.vendor }}
- Price: {{ product.price | money_without_currency }}
- Currency: {{ shop.currency }}
- Image URL: {{ product.featured_image | img_url: 'master' }}
- Product URL: {{ shop.url }}{{ product.url }}
- Availability: {% if product.available %}https://schema.org/InStock{% else %}https://schema.org/OutOfStock{% endif %}
The | escape and | strip_html filters are important for JSON safety — they prevent HTML or special characters from breaking your JSON. Always include them.
Sell Custom Apparel — We Handle Printing & Free ShippingAdding FAQ Schema to Product Pages
Product pages with FAQs (sizing, shipping, materials, returns) should include FAQ schema in addition to Product schema. They work together — both can show in the same search result.
The cleanest pattern: store FAQs as metafields on the product, then loop through them in your Liquid template to generate both the visible HTML and the JSON-LD. Here's a simplified version:
{% if product.metafields.custom.faqs %}
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "FAQPage",
"mainEntity": [
{% for faq in product.metafields.custom.faqs.value %}
{
"@type": "Question",
"name": {{ faq.question | json }},
"acceptedAnswer": {
"@type": "Answer",
"text": {{ faq.answer | json }}
}
}{% unless forloop.last %},{% endunless %}
{% endfor %}
]
}
</script>
{% endif %}
You'll also need to display the FAQs visibly on the page (Google requires it). Loop through the same metafield in your visible HTML.
LocalBusiness Schema for Stores With a Physical Location
If your Shopify store has a physical retail location (or you offer local pickup), add LocalBusiness schema to your homepage. Edit theme.liquid (the main layout file, not product.liquid) and paste a script block before the closing head tag.
Use only one block per location. If you have multiple stores, create dedicated location pages and add the schema to each. The homepage gets Organization schema instead, with sameAs links to the location pages.
For Liquid integration, you can pull some values from Shopify's shop object: {{ shop.name }}, {{ shop.url }}, {{ shop.email }}. The rest (address, hours, phone) you'll hardcode based on your actual store info.
Validating Your Custom Shopify Schema
After saving theme.liquid changes, view a live product page and run it through Google's Rich Results Test. If the schema validates, you're done. If it doesn't, the test will show you exactly which line is broken.
Common issues with Shopify schema:
- Liquid variables outputting empty strings (causes invalid JSON) — wrap fields in {% if %} checks
- Special characters in product names or descriptions breaking JSON — use the | escape and | json filters
- Duplicate Product schema (Shopify default + your custom) — disable the default by editing or removing it from product.liquid
- Image URLs without the protocol (// instead of https://) — use the | img_url filter to get full URLs
Once validated, monitor the Merchant Listings report in Search Console. It tracks schema across your entire product catalog and flags any errors as Google crawls.
Try It Free — No Signup Required
Runs 100% in your browser. No data is collected, stored, or sent anywhere.
Open Free Schema Markup GeneratorFrequently Asked Questions
Will adding custom schema break Shopify's default schema?
Only if you don't remove the default first. Having both creates duplicate schema, which Google flags as an error. Either remove the default Product schema from product.liquid before adding yours, or extend it instead of replacing.
Do I need a paid Shopify plan to edit theme.liquid?
No. Theme code editing is available on every Shopify plan, including the Basic tier. The Edit Code feature works the same regardless of plan.
Can I add schema without editing theme files?
Yes, you can use Shopify's Custom Liquid section in the theme editor for some templates, or paste schema into a "Custom HTML" block on individual product pages via the rich text editor. But theme file editing scales better for site-wide schema.
Does my Shopify schema affect Shopify's built-in JSON-LD for headless stores?
For headless setups (Hydrogen, custom front-ends), you skip Liquid entirely and generate schema in your front-end framework using product data from the Storefront API. The same fields apply, just rendered differently.
How do I add Article schema to Shopify blog posts?
Edit article.liquid (or sections/article-template.liquid). Paste a script block with Article schema, using Liquid variables like {{ article.title }}, {{ article.author }}, {{ article.published_at }}, and {{ article.image | img_url }}.
Will Shopify's app store apps conflict with my custom schema?
Most SEO apps that add schema (Yoast, JSON-LD for SEO, Schema Plus) will conflict by adding their own Product schema on top of yours. If you're going custom, uninstall any schema-related apps to avoid duplication.

