How to Add an Announcement Bar with a Countdown to Squarespace
October 30, 2026 · 5 min read
An announcement bar is the strip across the top of a website: "Free shipping over $50", "Closed Thanksgiving Day", "Registration closes Friday." It's seen on every page, which makes it the best spot for anything time-sensitive.
Squarespace has one built in. This guide covers what it does, where it falls short, free code for a countdown bar, and how to schedule and rotate messages.
Squarespace's built-in announcement bar
You'll find it in the Website or Marketing tools, under Announcement Bar. Turn it on, type a message, optionally add a link, and it appears across the top of every page in your site's colors.
It's simple and reliable, and for a single standing message ("Now booking spring appointments") it may be all you need. Its limits show up with anything time-based:
- No schedule. It's on until you remember to switch it off. A sale that ends at midnight Sunday keeps advertising itself Monday morning.
- No countdown. You can't show "ends in 2 days, 4 hours." A deadline you can see ticking down is one of the strongest nudges in marketing.
- One message. You can't rotate "Free shipping" with "New arrivals" and "Holiday hours."
- Every page. You can't show a shop-only offer just on shop pages, or hide the bar at checkout.
The free way: a countdown bar in a Code Block
This works on Core, Plus and Advanced plans (and legacy Business and Commerce), because it uses a little JavaScript. Add a Code Block at the top of the page that needs it, set it to HTML, and paste:
<div id="sale-bar" style="background:#1f2a24;color:#fff;text-align:center;padding:10px 16px;font-size:15px">
Fall sale: 25% off ends in <strong id="sale-clock"></strong> · <a href="/shop" style="color:#fff">Shop now</a>
</div>
<script>
(function () {
var end = new Date("2026-11-30T23:59:00"); // your deadline
var bar = document.getElementById("sale-bar"), clock = document.getElementById("sale-clock");
function tick() {
var s = Math.floor((end - new Date()) / 1000);
if (s <= 0) { bar.remove(); return; } // hide when the sale ends
var d = Math.floor(s / 86400), h = Math.floor(s % 86400 / 3600), m = Math.floor(s % 3600 / 60);
clock.textContent = (d ? d + "d " : "") + h + "h " + m + "m " + (s % 60) + "s";
setTimeout(tick, 1000);
}
tick();
})();
</script>
Change the date, message, link and colors. When the deadline passes, the bar removes itself.
What it doesn't do: it only appears where you place the Code Block (not site-wide, unless you put it in Code Injection → Header, which also places it at the top of every page), it can't be closed by visitors, it shows one message, and it doesn't move your site header, so on templates with a fixed header it may sit underneath it. To keep things simple, use it on one landing page.
Time zones: a date written like 2026-11-30T23:59:00 uses each visitor's own time zone. To end at midnight in *your* time zone for everyone, add the offset, for example 2026-11-30T23:59:00-06:00 for US Central.
Scheduling messages in advance
If you announce something every few weeks, like sales, events, closures and new arrivals, it's easier to plan them all at once. A Google Sheet works well:
| Message | Link | Start | End | Countdown |
|---|---|---|---|---|
| We're closed Thanksgiving Day. Happy holidays! | 11/20/2026 | 11/26/2026 | ||
| Black Friday: 30% off. Ends in {countdown} | /shop | 11/27/2026 | 11/30/2026 | 11/30/2026 11:59 PM |
| Free shipping on orders over $50 | /shipping |
A bar that reads the sheet shows whichever rows are active right now, rotates between them, and drops each one when its end date passes. Your team edits the sheet; nobody touches the website. See How to Show a Google Sheet on Your Website for how publishing a sheet works.
On the Basic or Personal plan
Basic plans don't run JavaScript in Code Blocks or have Code Injection, so the free version won't count down. You can upgrade to Core, or load an announcement bar script through a Markdown Block in your site footer, which appears on every page and works on every plan. How to add custom code to Squarespace without upgrading explains the method and its caveats.
Announcement bar tips
- One idea per message, under about 70 characters so it fits on one line on a laptop and two on a phone.
- Make the link obvious: a short button ("Shop the sale") gets more clicks than underlined text.
- Let people close it. A bar that can't be dismissed starts to feel like an ad. Remember the choice, but show the bar again when the message changes.
- Don't cover the menu. On sites with a sticky header, the bar should push the header down, not sit on top of it. Check on a phone.
- Retire it on time. An expired "ends tonight" banner tells visitors the site isn't maintained.
The ready-made option
The Announcement Bar adds everything the built-in bar can't do:
- A live countdown, with an optional "sale has ended" message or automatic hiding at zero
- Start and end dates for each message, so it runs on schedule
- Several messages that rotate, with arrows, from a Google Sheet or typed into the snippet
- A close button that's remembered, and comes back when you change the message
- Show it only on certain pages (
/shop/*) or hide it on others (!/checkout) - Top or bottom of the screen, and it moves your sticky header down instead of covering it
- Works on every Squarespace plan: Code Injection on Core and up, a footer Markdown block on Basic. WordPress gets a settings screen.
Design yours first in the free Announcement Bar Builder, with a live preview. It's $19 once, for unlimited sites, including client sites. See it live: the bar at the top of that page is the demo.