Shopify Code Validation & Testing Guide
Before Deploying ANY Code – Run These Checks
Method 1: Shopify Theme Check CLI (BEST)
Install
npm install -g @shopify/theme-check
Run
theme-check /path/to/your/theme
What It Catches
- Invalid Liquid syntax
- Missing required schema fields
- Deprecated filters
- Performance issues
- Accessibility violations
- Security issues
Fix Errors
- Shows line numbers and exact problems
- Follow recommendations in output
- Re-run until 0 errors
Method 2: Shopify Online Store Editor (Built-in)
Location
Online Store → Themes → Actions → Edit code
How to Use
- Open any
.liquidfile - Errors show inline with red underlines
- Click error for details
- Shows in real-time as you type
What It Catches
- Liquid syntax errors
- Unbalanced tags (
{%without%}) - Invalid schema JSON
- Missing required attributes
Limitations
- Doesn’t catch all issues
- Less comprehensive than CLI
- Only shows errors in open files
Method 3: Theme Inspector Chrome Extension
Install
Chrome Web Store → Search “Shopify Theme Inspector”
How to Use
- Install extension
- Open your store in Chrome
- Click extension icon
- View performance metrics, Liquid renders, errors
What It Shows
- Liquid render times
- Section load times
- JavaScript errors
- Asset loading issues
- Performance bottlenecks
Method 4: Liquid Linter VS Code Extension
Install
VS Code Extensions → Search “Shopify Liquid”
Setup
- Install “Shopify Liquid” extension
- Open theme folder in VS Code
- Errors show inline
What It Catches
- Liquid syntax
- Tag balance
- Filter usage
- Variable scope issues
Method 5: Shopify Preview Before Publishing
Process
- Upload code to theme
- DO NOT publish
- Click “Preview” button
- Test thoroughly in preview mode
- Check browser console (F12) for errors
What to Test
- All page types (product, collection, home, etc.)
- Mobile responsiveness
- Forms submit correctly
- Navigation works
- Images load
- Payment icons appear
- Newsletter signup functions
Check Browser Console
Press F12 → Console tab Look for:
- Red errors (JavaScript failures)
- 404s (missing assets)
- CORS errors
- API failures
Method 6: Manual Code Review Checklist
Liquid Syntax
- [ ] All
{%have matching%} - [ ] All
{{have matching}} - [ ] All
{% if %}have{% endif %} - [ ] All
{% for %}have{% endfor %} - [ ] No nested
{% comment %}blocks
Schema Validation
- [ ] Valid JSON (no trailing commas)
- [ ] All
typevalues are valid Shopify types - [ ]
urltype fields have NOdefaultvalues - [ ] All required fields present (
name,settings) - [ ] Setting IDs use underscores, not hyphens
Shopify Standards
- [ ] Use
{{ 'asset.css' | asset_url }}not hardcoded paths - [ ] Use
{{ product.price | money }}not manual formatting - [ ] Use
{{ 'now' | date: "%Y" }}for current year - [ ] Use
{{ shop.name }}not hardcoded store name - [ ] Use
{% form 'customer' %}for newsletter, not HTML forms
ADA Compliance
- [ ] All text minimum 14px (16px body text)
- [ ] All interactive elements minimum 16px
- [ ] Contrast ratio 4.5:1 minimum
- [ ] All colors pure black (#000000) on light backgrounds
- [ ] All images have
altattributes - [ ] All buttons have
aria-labelif icon-only - [ ] Semantic HTML (
<footer>,<nav>,<header>)
Performance
- [ ] CSS in external file or
<style>tag, not inline - [ ] JavaScript at bottom or deferred
- [ ] Images use
loading="lazy" - [ ] SVGs inline for icons (not image files)
- [ ] No unnecessary third-party scripts
Validation Workflow (Use This Order)
- Write code
- Run Theme Check CLI → Fix all errors
- Check VS Code Linter → Fix warnings
- Upload to Shopify (unpublished theme)
- Check Online Editor → Fix any new errors
- Preview in browser → Test functionality
- Check Console (F12) → Fix JavaScript errors
- Test mobile → Check responsive design
- Run accessibility checker → Fix ADA issues
- THEN publish
Common Errors & Fixes
“Invalid schema: setting with id=’X’ default must be a string”
Fix: Remove default from url type settings
// WRONG
{"type": "url", "id": "link", "default": "https://example.com"}
// RIGHT
{"type": "url", "id": "link"}
“Unbalanced tag”
Fix: Count opening/closing tags
{% if condition %} <!-- +1 -->
{% if nested %} <!-- +1 -->
{% endif %} <!-- -1 -->
{% endif %} <!-- -1 -->
Total should equal 0
“Unknown filter: stylesheet_tag”
Fix: Use modern syntax
<!-- WRONG -->
{{ 'style.css' | asset_url | stylesheet_tag }}
<!-- RIGHT -->
<link rel="stylesheet" href="{{ 'style.css' | asset_url }}">
“Menu ‘footer-shop’ not found”
Fix: Create menu in Navigation with exact handle
- Go to Navigation
- Create menu
- Handle must match code exactly (case-sensitive)
“Payment icons not showing”
Fix: Enable payment methods
- Settings → Payments
- Enable at least one payment provider
- Icons auto-populate from enabled methods
Testing Checklist Before Going Live
Functionality
- [ ] All links work (no 404s)
- [ ] Forms submit successfully
- [ ] Search works
- [ ] Cart add/remove works
- [ ] Checkout loads
- [ ] Payment methods display
Content
- [ ] All images load
- [ ] Text is readable
- [ ] No Lorem ipsum placeholder text
- [ ] Contact info correct
- [ ] Store hours accurate
- [ ] Legal pages exist (Privacy, Terms)
Performance
- [ ] Page loads under 3 seconds
- [ ] No console errors (F12)
- [ ] Images optimized
- [ ] No broken assets
Mobile
- [ ] Responsive on phone
- [ ] Touch targets 44x44px minimum
- [ ] Hamburger menu works
- [ ] Phone number clickable
- [ ] Forms usable on mobile
Accessibility
- [ ] Keyboard navigation works (Tab through page)
- [ ] Screen reader compatible
- [ ] Color contrast passes
- [ ] Text is readable without zoom
- [ ] All form inputs labeled
SEO
- [ ] Meta titles set
- [ ] Meta descriptions set
- [ ] H1 tags present on pages
- [ ] Alt text on images
- [ ] Sitemap accessible
Tools Summary
| Tool | Best For | Installation |
|---|---|---|
| Theme Check CLI | Comprehensive validation | npm install -g @shopify/theme-check |
| Online Editor | Quick syntax checks | Built into Shopify |
| Theme Inspector | Performance debugging | Chrome extension |
| VS Code Liquid | Development workflow | VS Code extension |
| Browser Console | Runtime errors | F12 in browser |
When You See Errors
- Read the error message – tells you what’s wrong
- Note the line number – tells you where
- Check this guide – common fixes documented
- Google the exact error – Shopify docs have answers
- Test the fix – re-validate after changes
- Document the solution – for next time
Quick Reference Commands
# Install theme check
npm install -g @shopify/theme-check
# Run validation
theme-check /path/to/theme
# Run on specific file
theme-check sections/footer.liquid
# Auto-fix (use with caution)
theme-check --auto-correct
# Check specific category
theme-check --only LiquidTag
Resources
- Shopify Theme Check: https://github.com/Shopify/theme-check
- Liquid Docs: https://shopify.dev/docs/api/liquid
- Theme Best Practices: https://shopify.dev/docs/themes/best-practices
- Section Schema: https://shopify.dev/docs/themes/architecture/sections/section-schema
- WCAG Guidelines: https://www.w3.org/WAI/WCAG21/quickref/
Save this doc. Reference it before every deployment.
Last Updated: December 2025