Editing code
What to know before you edit your theme's files, and how the files are organized.
Updated
You can change the theme's files in the code editor, but you take on the upkeep. Support does not cover code you change, and your edits are not carried over when you update. Try a setting, a block or Custom Liquid first.
Before you start
- In Online Store > Themes, duplicate the theme and edit the copy.
- Write down every file you change.
- Test on desktop and phone widths before you publish the copy.
How the files are organized
| Folder | What is in it |
|---|---|
sections | Sections, plus the header and footer groups |
blocks | Theme blocks |
snippets | Shared pieces such as price, product card and localization form |
templates | JSON templates that list the sections on each page |
layout | theme.liquid, the frame around every page |
config | settings_schema.json and your saved settings |
locales | Storefront text and editor labels, one file per language |
assets | CSS and JavaScript |
Scripts
Themes load some scripts on every page and others only with the section that needs them. Some themes ship readable, unminified assets with no build step. Others do not, so check your theme's guides before you edit.
Good habits
- Change one thing at a time.
- Prefer new files or a Custom Liquid block over editing core files.
- Do not edit the
localesfiles for text. Use Edit default content. See Changing default text.
Related
Still stuck? Get theme support