Each Online Store 2.0-compatible theme includes a Custom liquid section to add custom code to your storefront.
Avoid direct theme file adjustments by adding the Custom liquid section to a page and using the provided field to include Liquid-formatted code.
Add the Custom liquid section
- From your Shopify admin, go to Online Store > Themes, then click Edit theme.
- Navigate to the template where you'd like to add custom code.
- Click Add section, then select Custom liquid from the list.
- Paste your Liquid, HTML, CSS, or JavaScript code into the Liquid field.
- Click Save.
You can reorder, duplicate, or remove the section at any time, just like any other section on the page.
Benefits of using the Custom liquid section
- No file editing required: add custom code without opening or modifying your theme's underlying template files.
- Safer theme updates: because the code lives in a section rather than a core template, it's less likely to be overwritten or lost when you update your theme.
- Flexible placement: drop it into any section-enabled template — home page, product page, cart, and more — and reorder it like any other section.
- Easy third-party integrations: a common way to add tracking pixels, review widgets, trust badges, or other embeds without developer help.
- Low risk to revert: since the code is isolated to one section, removing or disabling it won't affect the rest of the page.