Custom Liquid in Shopify: How to Add It Safely (Without Breaking Your Theme)

F
Faisal Hourani
| 12 min read min read
Custom Liquid in Shopify: How to Add It Safely (Without Breaking Your Theme) — LiquidBoost Blog

Custom Liquid sounds scarier than it is.

Most of the time it is a single box in your theme editor where you paste a few lines of code. The hard part is not the pasting. It is knowing where the box lives, what it refuses to run, and when to stop using it and edit theme files instead.

Diagram comparing three ways to add custom Liquid to a Shopify store: the Custom Liquid section, a snippet rendered from theme code, and a section with its own schema

What Is Custom Liquid in Shopify?

Custom Liquid is a place in a Shopify theme where you write your own Liquid and HTML instead of using a built-in option.

Custom Liquid in Shopify is a code field that accepts HTML and a limited set of Liquid markup, so you can add content your theme has no setting for. Per Shopify's developer documentation, the underlying liquid setting type caps content at 50kb.

Liquid is the template language behind every Shopify storefront. If you have never touched it, our beginner's guide to Shopify Liquid covers objects, tags and filters in about ten minutes.

Here is the part most tutorials skip. "Custom Liquid" is not one feature. It is three different things people call by the same name:

  1. The Custom Liquid section. A ready-made section in the theme editor with one code box. No file editing.
  2. A snippet you render from theme code. A reusable .liquid file that you call with {% render %}.
  3. A custom section with its own schema. A theme file that adds settings for merchants to change in the editor.

Shopify's free Dawn theme ships the first one. Its Custom Liquid section on GitHub is a single code field plus padding and color settings. Other themes may name it differently or offer it as a block, so check your own block picker.

But which one should you use? That depends on the job, and we get there below.

How Do You Add Custom Liquid With the Theme Editor?

You add it as a section, paste your code, and preview before you save.

Adding Custom Liquid through the theme editor takes about five steps and needs no file edits. Shopify's help center notes each template can hold up to 25 sections, so a Custom Liquid section counts toward that limit like any other section you add to a page.

The steps, if your theme includes the section:

  1. In your Shopify admin, go to Online Store > Themes.
  2. Duplicate your live theme first. This is your undo button.
  3. On the copy, click Customize.
  4. Open the template you want to change (for example, a product page), click Add section, and pick Custom Liquid.
  5. Paste your code into the code box, drag the section where you want it, and preview on desktop and mobile.

The duplicate step matters more than it looks. Shopify's own help center page on customizing themes lists duplicating your theme as the first recommended task before you touch code. It is one click, and it gives you a clean copy to fall back on.

Also keep the page limits in mind. Shopify's help center says each template can have up to 25 sections and up to 1,250 blocks across all sections, with blocks nesting up to eight levels deep. You will rarely hit them, but a page stuffed with one Custom Liquid section per tiny tweak gets hard to manage long before it does.

If your theme has no Custom Liquid section, you have two options. Switch to a theme that has one, or build the section yourself, which the next parts of this post walk through.

Diagram of Shopify theme structure showing a template containing up to 25 sections, with each section holding blocks, up to 1,250 blocks per template and 8 levels of nesting

What Can't Custom Liquid Do?

It runs normal Liquid, but it blocks the tags and objects that control the whole page.

A Custom Liquid field can't access layout-level objects such as content_for_header, content_for_layout, section, schema or settings. It can use global objects, template objects like product, and standard tags and filters. Shopify documents these limits on its input settings page.

Here is the short version in one table.

Question Answer Why it matters
Can it use product, collection, cart? Yes, in templates where they exist Product-page messages work on product pages only
Can it use standard tags and filters? Yes if, for, assign, money, date all work
Can it use settings or section? No You can't read theme settings from inside the box
Can it use schema? No You can't add merchant settings; that needs a theme file
Is there a size limit? Yes, 50kb Long scripts belong in the assets folder
What happens with invalid Liquid? Saving fails with an error You find mistakes before customers do
Does it get translated? No Fine for code, bad for customer-facing words

Source: Shopify developer documentation, input settings (liquid type), checked November 2026.

Two details catch people out.

First, unclosed HTML tags are closed automatically when you save, per the same documentation. If your layout looks different after saving, that is why. Second, the field is not available in Translate & Adapt. If your store sells in several languages, put customer-facing words in translatable theme settings and keep the Custom Liquid box for logic.

Diagram listing what a Shopify Custom Liquid field can access, such as global objects, product and collection objects, and standard tags, against what it cannot, such as layout, section, schema and settings, with the 50kb limit

Here is what that looks like in practice. A snippet that works in a product template prints nothing on the homepage, because product does not exist there. It is not a bug. It is Liquid doing exactly what it should.

When Should You Edit Theme Code Instead of Using Custom Liquid?

Switch to theme files when you need reuse, merchant settings or more than 50kb.

Use theme files when the code repeats across pages, needs editor settings, or grows large. Per Shopify's snippet documentation, snippets are reusable Liquid files you call with the render tag, and they stay invisible to merchants in the theme editor.

A snippet is the right home for anything you would otherwise paste twice. You create snippets/free-shipping-bar.liquid, then call it wherever you need it:

{% render 'free-shipping-bar', threshold: 7500 %}

Change the snippet once and every page that renders it updates.

A custom section is the right home for anything a merchant should tweak without code. It adds a {% schema %} block at the bottom with settings:

<div class="promo-note">
  {{ section.settings.message }}
</div>

{% schema %}
{
  "name": "Promo note",
  "settings": [
    {
      "type": "text",
      "id": "message",
      "label": "Message",
      "default": "Free returns for 30 days"
    }
  ],
  "presets": [{ "name": "Promo note" }]
}
{% endschema %}

Shopify's section schema reference warns that a section can hold only a single {% schema %} tag, and placing it inside another Liquid tag causes a syntax error.

New to the code editor? Our guide to editing Shopify themes walks through the file structure and safe-editing habits.

Does this sound like your store? Skip the trial and error. Browse tested, drop-in Liquid snippets that paste into your theme in minutes. One-time purchase. No monthly app fee. 14-day money-back guarantee.

Which Custom Liquid Examples Are Worth Copying?

Start with small, honest wins: a shipping note, a free-shipping nudge and a low-stock line.

Three Custom Liquid examples cover most first projects: a product-tag shipping message, a free-shipping progress line and a low-stock notice. All three use standard Liquid objects, so they run inside the Custom Liquid section. Shopify's own documentation uses a tag-based product message as its example for the liquid setting type.

Each example below goes in a Custom Liquid section on the page named. Test on a duplicate theme first.

Example 1: A shipping message based on a product tag

Place this on a product template. It reads the product's tags and changes the message.

{% if product.tags contains 'ground-only' %}
  <p>This item ships by ground only. Allow extra delivery time.</p>
{% else %}
  <p>Ships by ground or air.</p>
{% endif %}

Tag a product ground-only in your admin and the message changes. No theme file is touched.

Example 2: A free-shipping progress line

Place this on the cart page. Prices in Liquid are in cents, so a USD 75 threshold is written as 7500.

{% assign threshold = 7500 %}
{% assign remaining = threshold | minus: cart.total_price %}

{% if remaining > 0 %}
  <p>You're {{ remaining | money }} away from free shipping.</p>
{% else %}
  <p>You've unlocked free shipping.</p>
{% endif %}

Be honest about the limit here. This renders when the page loads. If your theme uses a cart drawer that updates without a reload, the line will not move until the page refreshes. A drawer needs JavaScript. Also set the threshold in your store's own currency, because stores selling in several currencies need extra handling.

Example 3: A low-stock line

Place this on a product template. It only shows when stock is low and tracked.

{% assign variant = product.selected_or_first_available_variant %}
{% if variant.inventory_management and variant.inventory_quantity > 0 and variant.inventory_quantity <= 5 %}
  <p>Only {{ variant.inventory_quantity }} left in stock.</p>
{% endif %}

The same caveat applies. This checks the first available variant at page load, so it will not change when a shopper switches size. For that, you need variant-change JavaScript.

Decision flowchart: a one-off on one page points to the Custom Liquid section, otherwise needing editor settings points to a section with schema and not needing them points to a snippet with the render tag, with a note that live cart updates need JavaScript or an app

More ready-to-paste code lives in our 20 Shopify Liquid code examples, including trust badges and countdown timers.

What Mistakes Break Stores With Custom Liquid?

Most breakage comes from five habits, and all five are avoidable.

The five most common custom Liquid mistakes are skipping the theme backup, pasting code that uses objects the page doesn't have, stacking several unrelated snippets, ignoring mobile, and never re-testing after theme updates. Shopify lists duplicating your theme as a recommended task before any code change.

  1. Skipping the backup. Duplicate the theme first, every time. A broken live theme costs sales while you debug.
  2. Using an object the page lacks. product works on product pages, not on the homepage. Wrap code in {% if product %} when you are unsure.
  3. Pasting random forum code. Old snippets can use deprecated tags or clash with apps. Read what each line does before you paste it.
  4. Forgetting mobile. Check the preview on a phone width. Fixed-width HTML is the usual culprit.
  5. Never re-testing. A theme update can rename classes or move sections. Re-check your custom code after each update.

Two-sided honesty helps here. Custom Liquid is a strong tool for small additions, but it is a poor fit for anything your whole store depends on. Complex checkout-related logic, large scripts and multi-page features usually deserve proper theme files and a developer's review.

How Does Custom Liquid Compare With Apps and Ready-Made Snippets?

Each option trades control, cost and effort differently.

Custom Liquid costs nothing but your time, while ready-made snippets on LiquidBoost run USD 7.90 to 15.90 each as a one-time purchase. Apps usually add recurring fees and external scripts. The right pick depends on how often you will reuse the code and how much testing you want to own.

Option Skill needed Where it lives Reuse across pages Ongoing cost
Custom Liquid section Basic Liquid Theme editor One section per placement None
Snippet in theme code Intermediate Liquid Theme files High, via render None
Custom section with schema Intermediate Liquid and JSON Theme files High, with editor settings None
Ready-made LiquidBoost snippet Copy and paste Theme files Per install guide One-time purchase
Shopify app None App plus external scripts Handled by the app Usually recurring

Sources: LiquidBoost marketplace pricing, November 2026. Other columns are our own comparison based on the Shopify documentation cited above.

If you are weighing a paid developer against a ready-made option, our comparison of custom development vs. ready-made snippets breaks down the trade-offs. And if you want to change your store without hiring anyone, read how to customize your Shopify store without a developer.

Here is the rule we give store owners. Use Custom Liquid for one-off additions on one page. Move to a snippet the second time you copy the same code. Buy or build a proper section when merchants, not developers, need to change the content.

Frequently Asked Questions

What is custom Liquid in Shopify?

Custom Liquid is a code field in a Shopify theme that accepts HTML and limited Liquid markup. Shopify's documentation caps the content of the underlying liquid setting at 50kb. It lets you add messages, badges or embeds when your theme has no built-in option for them.

Where do I find the Custom Liquid section in Shopify?

Go to Online Store, then Themes, then Customize. Click Add section on the page you want to edit and choose Custom Liquid. Shopify's free Dawn theme includes it. Other themes may name it differently or not include it, so check your own section list first.

Can custom Liquid break my Shopify store?

Yes, but you can limit the damage. Duplicate your theme first, test the copy on desktop and mobile, then publish. Shopify blocks saving invalid Liquid in a liquid setting, which catches syntax errors early. Logic mistakes, like using the wrong object, still need a manual preview.

Do I need to know how to code to use custom Liquid?

Not for simple jobs. Pasting a tested snippet into a Custom Liquid section takes five steps and no file editing. Changing the logic needs basic Liquid knowledge, such as if tags and filters. For anything larger than 50kb or needing editor settings, you will need theme files.

Is custom Liquid better than a Shopify app?

For small additions, often yes: no monthly fee and no external script. Apps win when you need a managed dashboard, live cart updates or support. Custom Liquid runs when the page loads, so features that react to shopper actions usually need JavaScript or an app.


Need the finished version without the testing?

A tested snippet gives you the finished layout, mobile styling and install steps in one purchase. LiquidBoost snippets cost USD 7.90 to 15.90, include a 14-day money-back guarantee, and install in under five minutes without touching your whole theme.

Custom Liquid is a fine place to start. When you are tired of debugging one snippet at a time, a tested one saves the week.

Browse LiquidBoost's snippet marketplace →

One-time purchase per snippet. No monthly fees. 14-day money-back guarantee.

Keep Reading

Share
Boost Your Shopify Store

Ready to Implement What You've Learned?

Boost your Shopify store's performance with our ready-to-use code snippets. No coding required — just copy, paste, and watch your conversion rates improve.

Explore Snippets
Instant Implementation
No Coding Required
Conversion Optimized
24/7 Support

Related Articles

Stay Up-to-Date with Shopify Insights

Subscribe to our newsletter for the latest trends, tips, and strategies to boost your Shopify store performance.