Skip to content

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

  1. In Online Store > Themes, duplicate the theme and edit the copy.
  2. Write down every file you change.
  3. Test on desktop and phone widths before you publish the copy.

How the files are organized

FolderWhat is in it
sectionsSections, plus the header and footer groups
blocksTheme blocks
snippetsShared pieces such as price, product card and localization form
templatesJSON templates that list the sections on each page
layouttheme.liquid, the frame around every page
configsettings_schema.json and your saved settings
localesStorefront text and editor labels, one file per language
assetsCSS 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 locales files for text. Use Edit default content. See Changing default text.

Still stuck? Get theme support