Free sticky announcement bar generator

By Shailu016, founder of PopupLoom Published 20 November 2026 Last updated 20 November 2026

What this does. It writes a small, zero-dependency script that pins a one-line bar to the top or bottom of the page, with your text, an optional link, your colours and an optional close button that remembers the choice for the number of days you set.

What it does not do. It does not push the page content down, collect email addresses, schedule start and end dates, target particular pages or report views. The bar sits over the page edge, so check it does not hide your own header or cookie notice.

An announcement bar suits a shipping cut-off, a sale end date, a maintenance notice or a new feature. It is less disruptive than a dialog because it never covers the page centre and does not ask the visitor to act before they can read.

The generated code builds the bar from DOM nodes and sets your text with textContent, so an apostrophe or angle bracket cannot break the markup. The link only accepts web links, mail links and same-site paths; anything else is left out.

Build your snippet

Copy

A full web address, a mail link or a path on your own site.

Look and behaviour

Check the two colours have enough contrast to read.

Stored in localStorage. 0 shows the bar again on the next visit.

Preview

The preview shows the bar's look. Pinning and the dismiss memory work in the generated code on your own page.

Generated snippet

Paste it before the closing </body> tag, or into your platform's footer or custom-code area. Nothing is sent anywhere: the code only runs in the visitor's browser.

How the snippet works

  1. It checks for an earlier dismissal. If the visitor closed the bar inside the window you set, the script stops. If storage is blocked, the bar simply shows.
  2. It builds the bar. A fixed-position region is created in script with a label for screen readers, and your copy is inserted with textContent.
  3. It adds the link and close button you asked for. The close button removes the bar and stores the time.
  4. It pins to one edge. The bar uses fixed positioning at the top or bottom, above most page content.

What to test before you ship

Limits worth knowing

A fixed bar sits over the page rather than moving it, so on a site with its own sticky header the two can collide. This tool does not measure your layout. If you need the page pushed down, the bar's height has to be added to your theme's top padding by hand.

The snippet has no schedule, so remove it yourself when the message expires. If your site uses a strict Content-Security-Policy, an inline script needs a nonce or hash, or you can save the code as a file your site already serves.

Prefer a hosted popup instead of maintaining custom JavaScript? Open a matching template in the studio. It adds URL targeting, frequency rules, an email field and a lead inbox, and it installs with two lines of code on any site that allows a script. The no-limits page explains what the hosted version does and does not include.

Common questions

Is the generated announcement bar code free to use?

Yes. The code is yours to use and change, with no attribution required. It is provided as-is without warranty, so test it on your own site first.

Will the bar push my page content down?

No. It is pinned over the top or bottom edge. If it covers your header, use the bottom position or add padding to your theme by hand.

Can I set a start and end date?

Not in this generator. Remove the snippet when the message expires, or use a builder that supports scheduling.

Where do I paste the code?

Before the closing body tag of your page, or in your platform's footer or custom-code area. On WordPress that usually means a code-snippet plugin or a child theme; on Shopify, theme code outside checkout; on Webflow, a custom code embed.

Does a sticky bar affect search ranking?

A slim bar that does not cover the main content is not the intrusive-interstitial pattern Google describes for phones, but the generator makes no ranking claim. Keep it short, easy to close and out of the way of your navigation.

Method and limitations

The generator runs entirely in your browser. It writes code from your inputs and does not send them anywhere. The snippet is provided as-is, without warranty, and was previewed in this page but not tested on every browser, theme or platform. No conversion rate, traffic or revenue claim is made.

Written by Shailu016, founder of PopupLoom. Last updated 20 November 2026. Corrections: support@popuploom.com.