Themes & the visual editor
Edit visually with sections and blocks in Themes & the visual editor.
The code editor lets you edit your theme’s raw files — Liquid, CSS, JavaScript, JSON config, locales, and assets — instead of (or alongside) the drag-and-drop visual editor. It’s a full in-browser editor with a file tree, syntax highlighting, multi-tab editing, per-file revision history, and the same draft-then-publish model as the rest of the theme tools.
Open Online store → Themes, then choose Edit code on any theme to launch it.
The code editor has three parts:
Draft saved, file path, and which version you’re viewing), the version picker, and the Preview, Visual editor, Delete, and Publish actions.Each open file keeps its own buffer, so you can switch between tabs without losing unsaved work in any of them. If you try to leave the page or close a tab with unsaved edits, you’re warned first.
In the file tree, expand a folder (for example Sections) and click a file. It opens in a new tab and loads in the editor.
Edit the contents. The tab shows an orange dot and the top bar flips to Unsaved changes while a file is dirty.
Press Save — the button on the tab strip, or Ctrl/Cmd + S. JSON files are auto-formatted on save. The badge returns to All changes saved and a File saved toast confirms it.
If you want to throw away local edits and reload the last saved draft of the active file, use Current version in the top bar. If the file has unsaved changes, you’re asked to confirm — reloading discards those edits.
Each editable folder in the tree has a + (Create file) button. The exact dialog depends on the folder, but they all generate the correct path for you.
For Layout, Templates, Sections, Blocks, Snippets, and Locales, the + opens a create dialog where you enter a name and (where relevant) pick a format.
Click + on the folder, for example Sections.
Choose the file format — Liquid or JSON for sections — and enter a name. Use lowercase letters, numbers, hyphens, and underscores only.
The dialog previews the path it will create (for example sections/hero.liquid). Choose Create, and the new file opens in the tree ready to edit.
Creating a template also asks for the template type (Product, Collection, Page, and so on), and — for a metaobject template — a subtype. Add an optional suffix to make an alternate template such as templates/product.bold.json.
The Assets folder’s + opens Add asset with two tabs:
Open the file, then choose Delete in the top bar and confirm. This removes the file from the current draft only — published versions still contain it. Protected/system files can’t be deleted (the Delete button is disabled for them).
Every time you save a text file, the editor keeps a revision. With a text file open in the draft, a File history strip appears below the editor listing recent revisions as time-ago buttons (newest first), each with a tooltip showing the exact timestamp.
Click a revision button to load that historical content into the editor. The top bar shows a Viewing old revision badge and the pane becomes read-only — you’re inspecting, not editing.
To keep that old content, choose Restore to draft and confirm. The selected revision becomes the new draft content for the file (and a fresh revision is recorded).
To go back to the live draft without restoring, choose Return to latest draft.
The version picker in the top bar (the clock button) lets you switch what the editor is showing. It lists Current draft plus every published version (V1, V2, … with any release label and publish date).
Choosing a published version opens it as a read-only snapshot. A banner reads You are browsing a published snapshot, the file tree disables create/rename/delete, and you can open any file to inspect exactly what shipped in that version — but you can’t edit it in place. Switch back via Current draft at any time.
You can also reach a snapshot straight from Online store → Themes: expand View versions on a theme and choose Browse on any version.
To make an old published version editable again, copy it into the draft.
While browsing a published snapshot, choose Start draft from this version in the top bar.
Confirm the replace. Every file from that version is copied into the draft, overwriting your current draft changes.
The editor returns to the draft view, now matching the chosen version, ready to edit and re-publish.
The Themes page offers the same thing as Use as draft under View versions — it opens the editor and prompts you to replace the draft with that version.
Publishing turns your saved draft into a new live version.
Save every open file you want included — only saved draft content is published.
Choose Publish in the top bar. In the Publish theme dialog, optionally enter a Release label (for example Summer update) to identify the snapshot later.
Choose Publish. A new live version is created from the current draft and the storefront switches to it. The draft stays editable.
Published versions are immutable and numbered, so you can always roll back. To revert the live store to an earlier version, open Online store → Themes, expand View versions, and choose Make live (or Set live) on the version you want — see Manage themes.
The draft is shared across the code editor, the visual editor, and other browser tabs. If the same draft is changed elsewhere after you opened the editor, a save can be rejected to protect the newer content. Reload the editor to pick up the latest draft, then re-apply your change. Avoid editing the same file in two tabs at once.
Themes & the visual editor
Edit visually with sections and blocks in Themes & the visual editor.
Manage themes
The full library, versions, and rollback in Manage themes.
Alternate templates
Give products, collections, or pages their own layout with alternate templates.
Theme architecture
How files fit together in theme architecture.
Related: Import a theme ZIP · Liquid objects · Section schema · Setting types