How to mark your custom Shopify code so future updates are easy

When you or someone on your team edits your Shopify theme code, it’s easy to forget what’s custom and what came with the theme. Months later, you’ll want to upgrade or switch themes - and suddenly you’re guessing which lines to copy over.
A few seconds of adding simple code comments can prevent that problem entirely.
Why commenting your custom Shopify code matters
Shopify themes get updated regularly, and new versions often overwrite older files.
If you’ve customized your theme directly, you’ll need to reapply those changes after upgrading.
Without clear markers, this becomes a long, manual search through dozens of files.
When you add clear comments around your edits, you create a roadmap for your future self (or your developer) to follow. It makes it easy to:
Identify which parts of the theme contain your changes
Migrate customizations safely to new versions
Troubleshoot or roll back edits when something breaks
Even if you’re not a developer, comments are like sticky notes in your code. They help you stay organized when projects or people change.
The simple habit: add a recognizable comment
Every time you add or change something in your theme files, mark it clearly. The goal isn’t fancy formatting, just something consistent and searchable.
For example, when adding a new piece of Liquid code, write a comment above it like this:
{% # Custom code %}
Then your code:
{% # Custom code %}
{{ my_new_code }}
If you’re editing an existing line, comment out the old one but still label it:
{# Custom code #}
{{ my_new_code }}
{% comment %}{{ my_old_code }}{% endcomment %}
That single habit saves huge amounts of time later. When you want to migrate, just open the theme code editor and search for “Custom code” in your text editor. You’ll instantly see every line you’ve added or changed.

Adding context for clarity
Sometimes you’ll thank yourself later for including a little extra information. Comments can include a short note about what the code does or where related edits live.
For example:
{% # Custom code - Added upsell feature, see main-product.liquid %}
or
{% # Custom code - Connects to Klaviyo form snippet %}
This is especially useful if your customization spans multiple files, such as a section and a snippet. You can leave notes nearby to guide the next person working on it.

When this habit really pays off
Here are a few real-world cases where this small step makes a big difference:
Upgrading to a new theme version. Instead of manually comparing hundreds of lines, you can just search for your comment tags and reapply only those snippets.
Migrating to a different theme. When switching designs, you’ll need to bring over custom features like popups, banners, or special logic. Comments make it clear what belongs to you.
Handing work to a new developer or agency. Clear comment markers tell them where not to touch, or where to check before making changes. It makes collaboration smoother and avoids rework.
Debugging after an update. If something breaks, you can quickly find what’s custom and isolate whether the problem’s in your code or in the theme itself.
FAQ
Do I need to add comments for every tiny change? Generally, yes. Even if it sounds like a tiny change now, when you move over to a new theme, if you skip copying the code you might miss something that makes a difference in user experience.
Will comments affect how my theme works? No. Shopify’s Liquid and JSON formats ignore comment syntax. They’re safe to use and won’t affect performance.
What about JSON templates?
JSON templates allow comments - just with a different syntax: // Custom code
Can I use a different tag instead of “Custom code”? Yes, as long as you’re consistent. The point is to have a keyword you can search for later. Many teams use something like “Modified by [agency name]” or “Custom feature”.
What if multiple people are editing the theme?
A good idea is to include initials or a short name in your comments, like {% # Custom code - AJ %}
. It makes it easy to know who made what change.
Wrapping up
Theme updates don’t have to be stressful. Adding small, consistent code comments now saves you hours later - whether you’re upgrading, migrating, or collaborating.
Next time you make a tweak, take the extra five seconds to mark it. Future you will be glad you did.