The shop is closed for a week over the holidays. Deliveries are running late. You have moved to a new address, or there is a sale on until the end of the month. You want one line of text across the top of every page that says so, and you want to be able to take it down again without hunting through settings.
That strip is usually called an announcement bar or top notification bar. There are three sensible ways to add an announcement bar in WordPress: as blocks in the header of a block theme, through your theme’s own top bar setting, or with a small plugin when you need extras like a close button or a schedule. Whichever you pick, the wording matters more than the method.
Write the message first
The bar is only as good as the sentence in it, and most of the problems with these bars are problems of wording. Before touching any settings, write the message and check it against a few rules:
- One message. If you have two things to say, choose the more urgent one.
- Short enough for one line on a phone. Roughly the length of a text message preview. “Closed 24 to 26 December. Orders placed now ship on the 27th.” works. A paragraph does not.
- Dates, not “soon”. A date tells people whether it affects them, and it tells you when the bar must come down.
- At most one link, to the page with the details.
Three ways to add an announcement bar in WordPress
| Method | Works with | Close button | Scheduling |
|---|---|---|---|
| Blocks at the top of the header template part | Block themes | No | No, you add and remove it by hand |
| Theme top bar or header builder | Many classic themes | Depends on the theme | Rarely |
| Notification bar plugin | Any theme | Usually | Often, depending on the plugin |
If you only need a plain bar for a week or two, the first two are enough and add nothing extra to the site. A plugin makes sense when you run notices often, want visitors to be able to close them, or want them to appear and disappear on set dates. Which of the first two applies depends on how your header is built, and our overview of the WordPress header, footer and menus helps you check.
Block themes: a Group at the top of the header
Block themes keep their header as a shared template part, so a bar added there appears on every page that uses it. If the Site Editor is new to you, our guide to how templates and template parts work explains where your changes are saved and how to reset them.
- Go to Appearance → Editor → Patterns and open the Header template part, or select the header from a template and choose to edit it.
- Open List View. Select the first block inside the header, usually a Group holding the logo and menu.
- Insert a new Group block above it. Inside it add a Paragraph with your message.
- Give the Group a background colour that stands apart from the rest of the header, and a text colour with strong contrast. Reduce its padding so the bar stays slim.
- Centre the text, add the link if you need one, and press Save. The save list will show the header template part as changed.
To take it down, select the Group and delete it, then save. If you run the same kind of notice every year, select the Group before deleting it and use the block options to create a pattern from it. Next time you insert the pattern and edit the dates instead of building it again.
A bar made from core blocks cannot be closed by visitors and will not switch itself off. That is fine for short notices, as long as someone is responsible for removing it.
Classic themes: the theme’s top bar
Many classic themes have a built-in strip above the header for contact details or short notices.
- Go to Appearance → Customize and look in the Header or Header Builder panel for a Top Bar, Above Header or similar row.
- Switch it on and add a text or HTML element with your message. Some themes instead provide a top bar widget area under Appearance → Widgets, where a Paragraph block does the job.
- Set the colours and, if the theme allows it, choose whether the bar shows on mobile.
- Publish and check the live site.
If you run a WooCommerce shop on a classic theme, WooCommerce has its own option: Appearance → Customize → WooCommerce → Store Notice. Tick the option to enable it and type the message. It comes with a link visitors can use to dismiss it. Where it appears on the screen depends on your theme.
If the header is built in Elementor or another page builder, add a narrow section or container at the top of the builder’s header template instead. The theme’s top bar setting will not affect a builder header.
Plugins for bars that close or run on a schedule
The WordPress.org plugin directory has several notification bar plugins. When choosing one, look for:
- A close button that remembers. Once someone closes the bar, it should stay closed as they move between pages, not reappear on every click.
- Start and end dates, so a sale notice goes away on its own.
- Page rules, if a notice only applies to the shop or to one service.
- A light footprint. A one-line bar should not need a large script. Check that the plugin is actively maintained and has recent updates.
Keep the feature set modest. A bar that slides in, flashes and counts down is closer to a popup, and popups have their own rules, particularly on phones. If that is what you need, read our guide to adding a popup in WordPress instead. For a sale with a deadline, the separate guide to countdown timers and honest deadlines is more useful than a ticking bar.
Should visitors be able to close it?
A close button is polite for notices that are nice to know, such as a sale or a new blog post. It is less suitable for notices that affect everyone, such as a holiday closure or a delivery delay, because a visitor who closed it on Monday will not see the update you made on Wednesday. For important notices, a slim bar without a close button, removed promptly when it no longer applies, is usually better.
Keep it current, and watch the phone view
A notice about a sale that ended last month tells visitors the site is not looked after. When you put a bar up, put the removal date in your calendar at the same time. Our WordPress owner’s guide suggests a regular read-through of your main pages for exactly this kind of stale detail.
On phones, the bar adds height above the logo and menu, and long messages wrap onto two or three lines. Check it on your own phone in a private tab. If your header stays fixed while scrolling, decide whether the bar should stay with it; usually it is better to let the bar scroll away and keep only the slimmer header pinned. Our guide to the sticky header and its effect on phones covers that setting.
Mistakes to avoid
- Moving text or rotating messages. Scrolling or rotating text is hard to read and harder to tap. Show one message, still.
- Low contrast. A pale bar with pale text looks tidy and is ignored. Make it readable outdoors on a phone.
- Two bars at once. A theme top bar plus a plugin bar plus a cookie notice stacks up quickly. Keep one bar.
- Editing the theme’s header file. A theme update will remove the bar, and possibly at a bad moment. Use the editor, Customizer or a plugin.
Frequently asked questions
Can I show the announcement bar on some pages only?
With a block theme, you can make a second header template part with the bar and use it only in the templates that need it, such as the shop template. Many notification bar plugins have page rules for this. Theme top bars usually show on every page, with no per-page control.
Can the bar appear and disappear on set dates automatically?
Not with core blocks or most theme top bars, which stay until someone removes them. Several notification bar plugins offer start and end dates. If you use one, test the end date with a short trial notice first, and check that your caching plugin does not keep showing the old version after it ends.
Can I put a button in the bar instead of a text link?
Yes. In a block theme, add a Buttons block inside the bar’s Group next to the Paragraph, and many notification bar plugins have a button option of their own. Keep it to one small button with a clear label, such as See holiday hours, and check that the bar still fits on one or two lines on a phone.
Is an announcement bar the same as a cookie consent banner?
No. A cookie banner exists to collect consent before certain scripts run and needs to record the visitor’s choice. An announcement bar only displays a message. Do not try to use one for the other; if you need both, make sure they do not stack on top of each other on phones.
A bar that switches itself on for the holidays and off again afterwards takes a plugin or a little custom work. Our WordPress support service can set one up, even on a custom-built header, and then show you how to change the wording yourself.