A Shopify countdown timer shows shoppers exactly how long a sale has left, like “20% off ends in 2d 04h 15m.” Used honestly, it helps people plan a purchase. Used as a trick, it is fake urgency, and in the EU, the UK and the US that can break consumer law.
Shopify’s free themes, Dawn and Horizon, have no countdown block. In this guide I show you how to add one for free, with short code that counts down to a real end date and never resets on reload. I have set up sale timers on many client stores, and I tested this code in both themes on phone and desktop sizes.
Here is what you will learn:
- What makes a countdown timer real, and what counts as fake urgency
- The EU, UK and US rules in plain English
- Way 1: a sale timer at the top of every page
- Way 2: a timer on product pages, with the end date in a metafield
- How to add a password page countdown before you launch
- When an app is easier, plus fixes for common problems
What is a real Shopify countdown timer?
A real Shopify countdown timer counts down to the moment your offer actually ends. Every shopper sees the same end time. At zero, the discount stops and the timer disappears.
Fake urgency is the opposite. The clock restarts when you reload the page, or every visitor gets a fresh “15 minutes left.” Or the timer runs out, but the sale price stays. Shoppers notice, and you lose trust.

Is a sale timer legal? EU, UK and US rules
Yes, a sale timer is legal when the deadline is true. Trouble starts when it isn’t. This section is general information, not legal advice. If you are unsure, ask a lawyer in your country.
European Union
The Unfair Commercial Practices Directive (UCPD) lists practices that are banned in all cases. Point 7 of its Annex I bans “falsely stating that a product will only be available for a very limited time” to push a quick decision. The European Commission’s guidance on the directive (2021/C 526/01) is direct about it: “Creating urgency by falsely stating that a product will only be available for a very limited time… For example, this includes fake timers and limited stock claims on websites.”
On 11 November 2026 the Commission also proposed a Digital Fairness Act. Its draft blacklist adds a new point: stating a “very limited time” offer “without disclosing the duration of the promotional offer.” It is a proposal, not law yet. The Shopify countdown timer in this guide already shows the end date. If your timer sits next to a “was” price in the EU, the Omnibus price rules apply too. See my guide to the Omnibus Directive on Shopify.
United Kingdom
The Digital Markets, Competition and Consumers Act 2024 has a similar ban (Schedule 20, point 7). Since 6 April 2025, the Competition and Markets Authority (CMA) can fine a business up to 10% of global turnover without going to court. The CMA’s guidance says countdowns are misleading if “the sale price rolls on beyond the advertised end point.” It says the same about checkout timers that “start again when the webpage is refreshed.”
On 14 October 2026 the CMA fined Wayfair £4.8 million for “Flash Deals” with countdown timers, because many products stayed at the same price or lower after the deadline.
United States
Section 5 of the FTC Act bans “unfair or deceptive acts or practices.” The FTC’s 2022 staff report on dark patterns names the “Baseless Countdown Timer”: “a fake countdown clock that just goes away or resets when it times out.” There is no special timer law, but a false deadline can be a deceptive claim.
| Region | Rule | What it means for your timer |
|---|---|---|
| EU | UCPD Annex I, point 7 | False “limited time” claims are banned |
| EU (proposal) | Digital Fairness Act draft | Show how long the offer lasts |
| UK | DMCC Act 2024, Schedule 20 | Fines up to 10% of turnover |
| US | FTC Act, Section 5 | Fake deadlines can be deceptive |
The safe rule for all three: one real end date, the same for everyone, and the offer really ends then. Keep a record of the discount and its dates in case anyone asks.
Step 1: Set the real end date in Shopify first
A Shopify countdown timer only shows a deadline. Your discount enforces it. So create the discount first, with an end date.
- In your Shopify admin, go to Discounts and click Create discount.
- Choose Amount off products or Amount off orders.
- Under Method, select Automatic discount, or use a discount code if you prefer.
- In the Active dates section, set the start date and time. Then select Set end date and choose the end date and time.
- Click Save.
Shopify starts and ends discounts in your store’s time zone, as its guide to amount off discounts explains. Check yours under Settings, then General, in the Store defaults section. You need it for the next step. If a code doesn’t apply, my guide on Shopify discount codes not working covers the usual causes.

The timer needs the date plus your UTC offset. In December, common offsets are:
- New York (Eastern): -05:00
- Los Angeles (Pacific): -08:00
- London: +00:00
- Berlin, Paris, Madrid: +01:00
Summer offsets differ by one hour, so check the offset for your end date. To work out the sale price, try my free Shopify discount calculator.
Way 1: Add a Shopify countdown timer to the announcement bar
This puts a thin Shopify countdown timer at the top of every page. You paste one block of code into a Custom Liquid section. No theme files change, so it is easy to remove later.
In the Dawn theme
- Go to Online Store, then Themes, and click Customize.
- In the left sidebar, under Header, click Add section and choose Custom Liquid.
- Paste the code below into Liquid code.
- Set Top and Bottom padding to 0, and pick a Color scheme for the bar.
- Drag the section above or below the Announcement bar, then click Save.
In the Horizon theme
- Open the theme editor the same way.
- Under Header, click Add section and choose Custom Liquid.
- Paste the code into Liquid code.
- Pick a Background color and set Width to Full if you want an edge-to-edge bar. Padding already starts at 0.
- Drag it next to the Announcement bar and click Save.
The countdown timer code
{%- assign timer_end = '2026-12-15T23:59:00-05:00' -%}
{%- assign timer_text = 'Holiday sale: 20% off ends in' -%}
{%- if timer_end != blank -%}
<div class="zt-timer" data-end="{{ timer_end }}" hidden>
<span class="zt-timer__text">{{ timer_text }}</span>
<span class="zt-timer__clock" role="timer"></span>
<span class="zt-timer__date"></span>
</div>
{%- endif -%}
<style>
.zt-timer { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 2px 8px; padding: 8px 12px; text-align: center; font-size: 15px; line-height: 1.4; }
.zt-timer[hidden] { display: none; }
.zt-timer__clock { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.zt-timer__date { flex-basis: 100%; font-size: 13px; opacity: 0.75; }
</style>
<script>
(() => {
const pad = (n) => String(n).padStart(2, '0');
document.querySelectorAll('.zt-timer:not([data-ready])').forEach((box) => {
box.dataset.ready = 'true';
const raw = box.dataset.end.trim();
const end = /^\d+$/.test(raw) ? Number(raw) * 1000 : Date.parse(raw);
if (!end) return;
const clock = box.querySelector('.zt-timer__clock');
box.querySelector('.zt-timer__date').textContent =
'Ends ' + new Date(end).toLocaleString(undefined, { dateStyle: 'medium', timeStyle: 'short' });
const tick = () => {
const left = Math.floor((end - Date.now()) / 1000);
if (left <= 0) { box.hidden = true; return; }
const d = Math.floor(left / 86400);
const h = Math.floor((left % 86400) / 3600);
const m = Math.floor((left % 3600) / 60);
clock.textContent = (d ? d + 'd ' : '') + pad(h) + 'h ' + pad(m) + 'm ' + pad(left % 60) + 's';
box.hidden = false;
setTimeout(tick, 1000);
};
tick();
});
})();
</script>Change two lines at the top. In timer_end, put your discount’s end date and time, with your UTC offset. In timer_text, write your offer. Keep it short so it fits on a phone.
How it works: this Shopify countdown timer counts to one fixed moment. It stores nothing per visitor, so a reload shows the same time left. Under the clock, it shows the end date in each shopper’s own time zone, like “Ends Dec 15, 2026, 11:59 PM.” At zero, the bar hides itself. If the date has a typo, it stays hidden instead of showing a wrong number.

Prefer plain text with no clock? A line like “Sale ends Monday at midnight” in the announcement bar works too. My guide to the scrolling announcement bar shows how to rotate it with other messages.
Way 2: Add a sale timer to the product page with a metafield
A sale timer near the price is clearer when only some products are on sale. With a product metafield, each product gets its own end date. Products without one show nothing.
- Create the metafield. Go to Products and open any product. In the Metafields section, click Add definition. Name it Sale ends and check that Namespace and key reads custom.sale_ends. Click Select type, choose Date and time, and save.
- Set the date. On each sale product, pick the same end date and time as your discount, and save.
- Add the block. In Dawn, open the Default product template, click Add block in Product information, and choose Custom Liquid. In Horizon, click Add block inside the Details block of Product information, and choose Custom Liquid.
- Paste the code from Way 1, but replace its first two lines with the two lines below. Drag the block under the price and click Save.
{%- assign timer_end = product.metafields.custom.sale_ends.value | date: '%s' -%}
{%- assign timer_text = 'Sale price ends in' -%}The date filter turns the metafield into a plain number of seconds, so time zones can’t get mixed up. Shopify stores this metafield type in UTC. After you save, check that the “Ends” date on the product matches your discount.

Password page countdown for a store launch
A password page countdown tells early visitors when your store opens. It is a launch date, not a sales claim, but the same rule applies: keep the date true.
- Dawn: in the theme editor, open the page drop-down at the top and choose Password. Click Add section, choose Custom Liquid, and paste the timer code.
- Horizon: choose Password in the same drop-down, click Add block inside the Password section, choose Custom Liquid and paste the code.
Change the text to something like “We open in.” One catch: Shopify’s help center only describes opening a store by hand, under Online Store. So be ready to switch from Private to Public when the password page countdown hits zero. My Shopify launch checklist covers the rest.
How I tested the code
I ran this Shopify countdown timer in Chrome with Dawn’s and Horizon’s own CSS, at 360, 390 and 1280 pixels wide. The clock stayed on one line, with no sideways scroll.
A reload 5 seconds later showed 5 seconds less, not a fresh start. At the deadline the timer hid itself. A shopper in Berlin saw the end as 05:59 on 16 December, the same moment as 23:59 in New York. A bad date or an empty metafield showed nothing.
When a countdown timer app is easier
The free code covers one sale at a time. A Shopify countdown timer app makes sense if you run many timed offers, want timers in emails, or show timers only in some countries.
A popular option is
Essential Countdown Timer Bar. As of November 26, 2026, its App Store listing shows a 5.0 rating from 1,765 reviews and a free plan with up to 1,000 timer views a month. Paid plans start at $6.99 a month and add scheduled and recurring timers. Check the listing for current prices.
With any app, avoid “evergreen” timers that restart for each shopper. That is the fake urgency the CMA and the FTC describe. A daily “order within 2h 10m for same-day dispatch” timer is fine if your cutoff is real.
Which way should you use?
For one big sale, use the header timer. For a few products, use the product timer. Both are free.
| Method | Shows on | End date from | Cost | Best for |
|---|---|---|---|---|
| Header timer | Every page | One line of code | Free | Store-wide sales |
| Product timer | Product pages | A metafield | Free | Some products on sale |
| Password page | Launch page | One line of code | Free | Store launches |
| App | Many places | App settings | Free plan, then paid | Many timed offers |
Whichever Shopify countdown timer you pick, it is only accurate if your discount dates match.
Common problems and fixes
These are the Shopify countdown timer problems I see most often on client stores.
The timer is off by a few hours
The UTC offset is wrong. Use the offset of your store’s time zone on the end date, and remember summer time. For the metafield version, compare the “Ends” line with your discount.
The timer doesn’t show at all
The end date is in the past, has a typo, or the product has no Sale ends value. The code hides the timer in all three cases.
The timer ended, but the sale price is still there
The discount and the timer have different end times. Edit the discount’s Active dates to match. If you used compare-at prices instead of a discount, change them back yourself at the deadline, or the sale “rolls on” in the CMA’s words.
The text wraps onto three lines on phones
Shorten timer_text. “Sale ends in” is enough when the bar color already says “sale.”
Related guides
- Shopify Buy X Get Y: why it doesn't apply and how to add the free gift.
- Shopify newsletter popup: two free ways with proper consent.
- Shopify sticky add to cart: the Horizon setting and free Dawn code.
Frequently asked questions
Does Shopify have a countdown timer?
Not built in. Dawn and Horizon have no countdown block, so you add a Shopify countdown timer with a Custom Liquid section or block, or with an app.
How do I add a countdown timer to Shopify for free?
Create a discount with an end date, then add a Custom Liquid section in the header and paste the timer code from this guide with the same end date.
How do I add a countdown timer to my Shopify password page?
In the theme editor, switch to the Password page and add a Custom Liquid section (Dawn) or a Custom Liquid block inside the Password section (Horizon), then paste the code.
Are fake countdown timers illegal?
In the EU and the UK, falsely claiming an offer is only available for a limited time, to rush a decision, is banned outright. In the US, the FTC treats fake deadlines as possible deception. Use real end dates only.
Can a countdown timer reset for each visitor?
Technically yes, but don’t. A timer that restarts per visitor is the classic fake urgency example in CMA and FTC guidance.
What happens when the timer reaches zero?
The timer in this guide hides itself. Your discount must end at the same moment, so set its end date in Active dates.
An honest Shopify countdown timer is one of the easiest ways to make a sale feel clear and fair. For more guides like this, see my free Shopify tools and Shopify tips. If you would rather have it done for you, I set up sales, discounts and timers as part of my Shopify store management service. Message me on WhatsApp and I will take a look.




