How to Find the theme.liquid File in Shopify and Add Custom Code

Learn how to locate the theme.liquid file in your Shopify theme and safely add custom code for third-party tools, tracking scripts, and more.

What is the theme.liquid file?

The theme.liquid file defines the structure and layout of your website based on theme that you select in Shopify. Liquid just refers to Shopify’s templating language used to dynamically update the content on a page. A template essentially contains placeholders that will dynamically update as you use the Shopify GUI to insert content onto your website. The theme.liquid file is where you can add custom code to your website whenever you work with third-party providers. For example you may want to add a chat widget to your website or Google Analytics tracking code. The theme.liquid file is a great place to apply this code.

Where do I find the theme.liquid file?

  1. Go to your https://website-domain.com/admin to be taken to the Shopify dashboard
  2. Select Online Store in the left sidebar or search “Online Store” in the search bar if not visible
  3. Select Themes which appears underneath Online Store
  4. On the Themes screen select the three dark gray dots and select Edit code from the dropdown
  5. In the left sidebar select the theme.liquid file
  6. Add your custom code to the file and click save

It is important to be very careful editing this file as it affects the theme for the entire site.

No fluff. Just real projects, real value, and the path from code to cash — one useful build at a time.

Copyright 2025 Matthew Seiwert