Quick answer
If your Shopify theme breaks after a code edit, stop editing the live theme. Duplicate it, identify the file you changed, use the code editor Timeline/older versions when available, and compare against a fresh copy if needed.
Symptom
A small code edit broke the header, cart, product page, collection layout, mobile menu, or theme editor. The site may still load, but something is visibly wrong.
Most likely causes
- Wrong file edited. A global layout file can affect the entire store.
- Broken Liquid syntax. One missing bracket/tag can break rendering.
- Broken HTML structure. Unclosed tags can break layout or the theme editor.
- CSS conflict. A style meant for one area affects the whole theme.
- JavaScript error. One script error can break product forms, cart drawers, or menus.
Quick checks
- Stop editing the live theme.
- Duplicate the theme if you can.
- Write down exactly which file(s) you edited.
- Open the edited file in Edit code.
- Use Shopify’s Timeline/older versions to compare and restore a previous version when available.
- If you cannot identify the change, compare against a fresh copy of the same theme.
Theme, app, or code checks
- Check DevTools Console for JavaScript errors.
- Check the browser page source if a Liquid error appears.
- Look for missing closing tags in the area you edited.
- If the theme editor will not open, revert recent Liquid/JSON/template edits first.
- If a file was deleted, Shopify warns deleted theme files cannot be recovered; you may need a fresh theme copy.
When to stop guessing
Contact a developer or Shopify Support when the theme editor will not load, the affected file cannot be identified, or previous versions are not available. Do not keep stacking new fixes on top of a broken edit.
Prevention checklist
- Duplicate the theme before every code change.
- Edit one file at a time and test immediately.
- Copy current file contents somewhere safe before changing them.
- Use comments with dates when adding custom code.
- Keep a clean theme copy available for comparison.

