Edit your theme's code

You can change your theme's code files in the code editor of your Shopify admin. Checkout Beast support doesn't cover custom code changes, or problems caused by edited theme code. Most changes need no code file at all, because the theme editor takes your own Liquid and CSS.

Support for edited themes

Support answers questions about how the theme works, helps with its settings, and fixes bugs in the theme. It doesn't make custom code changes, and it doesn't fix problems that edited theme code causes. Support policy lists the rest.

Duplicate the theme first

Duplicate your theme before you or anyone else edits its code. To make the copy, go to Online Store in your Shopify admin, click the three-dot icon next to the theme, and select Duplicate. The copy shows under Draft themes. Edit the copy, check it, and publish it when it works. If something breaks, the original theme is unchanged, and you can start again from it.

A store can hold up to 20 themes on the Basic, Grow and Advanced plans. If you already have 20, remove one before you duplicate. Shopify's guide to duplicating themes has the steps for the Shopify app too.

You can't edit the code of a theme that is on trial. Buy it first, as Install a theme on your store describes.

Options before you edit code files

Try these in order. Each one is saved with your other editor changes, so a theme update keeps it.

Option

What it takes

Where you find it

Theme settings, and the settings of each section and block

No code

The theme editor

A Custom Liquid section or block

HTML and Liquid

Add section or Add block in the theme editor

Custom CSS for one section

CSS, up to 500 characters

At the bottom of the section's settings

Custom CSS for the whole theme

CSS, up to 1,500 characters

Theme settings > Custom CSS

Custom CSS takes precedence over the theme's own settings. Depending on the selectors and classes it uses, a theme update can make a Custom CSS rule stop working, so check your pages after each update. Shopify's guide to custom CSS lists what Custom CSS can't contain.

Code edits and theme updates

When you add a new version of your theme, Shopify includes your code edits in the updated copy if they don't conflict with the new version. Edits that an app made to your theme files count as code edits too. The updated copy shows one of these messages:

  • "Theme added: code edits successfully included"

  • "Theme added: code edits could not be included"

If your edits were left out and you want to keep them, copy them into the new version yourself. Save a copy of every file you changed before you update, so you have them at hand. Update your theme to a new version covers the rest of the update, and Shopify's guide to updating themes explains the conflict check.

Custom work by a developer

If you need custom work, a Shopify Partner can do it. Find one in the Shopify Partner Directory. Ask them to work on a duplicate of your theme.

Shopify's guide to editing theme code shows the code editor itself.

Was this article helpful?