Free sticky announcement bar generator
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
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
- 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.
- 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. - It adds the link and close button you asked for. The close button removes the bar and stores the time.
- 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
- Overlap. Check the bar does not cover your logo, menu, cookie notice or a sticky add-to-cart button. If it does, move it to the other edge.
- Mobile. The message should wrap to two lines without the close button covering text. Test a real phone.
- Dismiss. Close it, reload, and confirm it stays away for the number of days you set.
- Contrast. Read it on a bright screen and in a dark room. Pick colours with strong contrast.
- The link. Click it and confirm the destination.
- Stale messages. A bar that mentions a past date is worse than none. Remove it when the offer ends.
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.
Related tools and pages
- Popup HTML generator — a centred popup with a delay, close button and cooldown.
- Exit-intent code generator — a desktop-only trigger with sensitivity, delay and cooldown.
- Shipping notice bar template — a ready layout for delays and cut-off dates.
- Static HTML popup guide — where the two lines go on a hand-built site.
- Popup not showing? — a checklist for the usual causes.
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.