Signal Bar
An announcement bar at the top of your site with a button, your colours and a close button. Accessible, with no layout shift.
Coming to WordPress.org soon
Signal Bar puts one short message at the top of every page, or only the home page, with an optional button. Pick your colours and the settings screen shows a live preview and warns you when the text is hard to read.
The bar is printed as the first thing in the page, so it takes its space from the start and nothing jumps when it loads. When a visitor closes it, their browser remembers, and the bar is hidden before the page is drawn, so there is no flash either. Change the message and it shows again.
It is built for keyboard and screen reader users: a labelled region, a real close button with a large target, Escape to close, and focus moved to the next thing on the page after closing.
Nothing shows until you switch it on.
What the free version does
- Message with an optional link or button
- Your colours, with a contrast warning below 4.5:1
- Static or sticky at the top, centred or left
- Close button remembered in the visitor's browser
- Every page or the home page only
- No layout shift, no jQuery, under 2 KB of script
Pro
The free version is complete on its own. Pro adds:
- Start and end dates: the bar also hides itself on time on cached pages.
- Countdown: write {countdown} in the text for a live timer to the end date.
- Rotating messages: up to 10, with a pause button.
- Targeting: only on some paths, never on others, wide screens or phones only.
Privacy
No outside requests of its own and no cookies. A closed bar is remembered in the visitor's browser storage only, as a short code of the message.
Questions
Does it work with my theme?
Yes, if the theme calls wp_body_open, as every block theme and most classic themes do. With an old theme a small script moves the bar to the top.
Why can I not add HTML to the message?
Plain text keeps the bar safe and readable. The link fields add a link.
Will a page cache show an old bar?
The bar is part of the page, so clear the cache after you change it.