Theme.liquid Structural Checker
Check a theme.liquid file for the two Liquid objects Shopify actually requires, content_for_header and content_for_layout, plus their placement and a few HTML best practices.
How it works
- 1
Paste your theme.liquid
Copy the full contents of layout/theme.liquid from your theme and paste it in, or click Load minimal example to see a valid file.
- 2
Check the required results first
A red X means content_for_header or content_for_layout is missing or duplicated, this is worth fixing before anything else.
- 3
Review placement warnings
An amber warning on either tag means it was found outside the expected <head> or <body> section.
- 4
Check the recommended items
Doctype, lang attribute, viewport, and charset are good practice but won't break the theme on their own.
- 5
Copy the report if needed
Click Copy report to get a plain text summary of every check, useful for a PR description or a note to a client.
About the Theme.liquid Structural Checker
Every Shopify theme has exactly one layout file, theme.liquid, and it depends on two specific Liquid objects to function at all: {{ content_for_header }}, which Shopify uses to inject app scripts, tracking pixels, and required meta tags, and {{ content_for_layout }}, which is where every template's actual content renders. Remove either one by accident while editing the layout, and the theme breaks in a way that has nothing to do with whatever you were actually trying to change, apps stop working, or every page renders blank. This tool checks a pasted theme.liquid file for both, confirms they're placed correctly, and checks a handful of other well-established structural basics.
Why these two objects are non-negotiable
Unlike most Liquid you write yourself, content_for_header and content_for_layout aren't optional conveniences, they're the two points where Shopify's platform injects content into your theme. content_for_header is what makes installed apps, Shopify Pay, and various platform-level scripts actually load on every page, without it, apps that were working fine can silently stop functioning after a seemingly unrelated theme.liquid edit. content_for_layout is even more fundamental, it's the placeholder Shopify swaps in whatever template matches the current page, remove it and there's simply nothing left to render.
Why placement matters, not just presence
Having both tags somewhere in the file isn't quite the full picture, content_for_header specifically needs to sit inside <head> so the tags Shopify injects, meta tags, preload hints, script tags, land in a valid location, and content_for_layout needs to sit inside <body> for the same reason. This tool checks both presence and placement separately, since a tag technically present but sitting in the wrong part of the document is a real, if less common, way theme.liquid ends up subtly broken.
A few recommended, non-blocking checks too
Alongside the two required objects, this tool also checks for a handful of standard HTML practices worth having in any layout file: a <!doctype html> declaration, a lang attribute on <html> (Shopify's own reference themes set this to {{ request.locale.iso_code }} for accessibility and localization), a viewport meta tag for mobile rendering, and a charset meta tag. None of these will break a theme the way a missing content_for_header or content_for_layout will, so they're flagged as warnings rather than errors, worth fixing but not the reason a theme stopped working.
What this doesn't check
This is a structural check on theme.liquid specifically, it doesn't validate the rest of a theme's Liquid, check for broken sections, or confirm any app-specific requirements a particular app might document for its own installation. It's scoped narrowly to the one file where a small, easy-to-miss deletion causes the most disproportionate damage across an entire theme.
Runs entirely in your browser
Every check runs against the text you paste in, entirely in your browser, nothing is uploaded or sent to a server. If the issue turns out to be somewhere else in a section file rather than theme.liquid itself, our Section Schema Builder and Liquid Playground are part of the same Shopify Tools collection this tool belongs to.
Frequently asked questions
What happens if content_for_header is missing?
Apps, tracking scripts, and platform-injected meta tags won't load anywhere on the theme, which is a very common cause of apps appearing to suddenly stop working after an unrelated theme.liquid edit.
What happens if content_for_layout is missing?
Every template's actual page content has nowhere to render, since this is the specific placeholder Shopify swaps template content into.
Does it matter where these tags are placed in the file?
Yes, content_for_header should sit inside <head> and content_for_layout inside <body>. Both being present but in the wrong section is a less common but real way a layout file can still behave incorrectly.
Why are the doctype, lang, viewport, and charset checks warnings instead of errors?
None of them will break the theme the way a missing content_for_header or content_for_layout will. They're recommended standard practice, worth fixing, but not the cause of a genuinely broken theme.
Does this check my theme's sections or other Liquid files?
No, this is scoped specifically to theme.liquid's structure. Our Section Schema Builder and Liquid Playground cover section-level Liquid separately.
Can this tool fetch my live theme.liquid file automatically?
No, paste the file's contents directly, there's no live connection to a Shopify store or theme.
Why does it flag content_for_header appearing twice?
It should only appear once, having it twice would inject the same app scripts and tags into the page twice, which can cause duplicate tracking events or conflicting script behavior.
Is my theme file uploaded anywhere?
No, every check runs entirely in your browser against the text you paste in. Nothing is sent to a server.