OfferBanner for WordPress
Your banner plugin can't make a coupon. Your coupon plugin can't make a banner.
WordPress has a plugin for each half and nothing that joins them. An announcement-bar plugin draws a strip and lets you type anything into it, including a discount code it cannot check. A coupon plugin creates a real code but does not show it anywhere a visitor looks. So you copy the code from one and paste it into the other by hand, which is where a wrong code on a live banner comes from.
One script tag, pasted in the footer once, covers both halves: the banner, the dates it runs, and the code on it are all edited in one place. No PHP, no database, nothing new to keep updated.
01 — Install
Install the script tag
Get your site code
Sign up, add your site’s address, and the dashboard hands you a twelve-character site code and the line below with the code already in it. The code belongs to the host, not to a banner — you paste it once and it carries every campaign you ever run on that domain.
Install a header/footer scripts plugin
Plugins → Add New, then search for a scripts plugin — WPCode, Insert Headers and Footers, and Head & Footer Code all do the same one job. Install and activate.
This is the first path rather than the fallback for a reason: it works on classic themes and block themes alike, and it survives theme updates. A block theme has no
footer.phpto edit at all.Paste into the footer box
Open the plugin’s settings and find the box for Footer or Body scripts — the one described as “before
</body>”. Paste and save.<script src="https://offerbanner.com/embed.js" data-banner="YOUR_SITE_CODE" async></script>Replace
YOUR_SITE_CODEwith the code from your dashboard.Purge your cache and load the site
If you run WP Rocket, LiteSpeed, W3 Total Cache or your host’s own page cache, purge it once — the tag has to reach the cached HTML. After that you can ignore the cache: what the banner shows is fetched by the script when the page is viewed, so changing a banner never needs another purge.
Two other routes work and both have a catch worth knowing before you pick: a child theme’s functions.php (no extra plugin, but classic themes only), and a Custom HTML block (no setup at all, but only on the one page you put it on). Both are in the answers below.
02 — After the paste
What you can do once the tag is in
Everything below happens without touching WordPress again — no wp-admin, no cache purge, no update notice.
A calendar of scheduled campaigns
Each site has a schedule: entries that name a banner, a date window, and optionally the countries it runs in. Schedule Black Friday in September and it starts and ends on its dates. There is nothing to remember at midnight and nothing to log in and switch off.
Real Stripe discount codes
Connect a restricted Stripe key and the code shown on the banner is a real Stripe promotion code created in your own account — the half a banner plugin cannot do. The key can create coupons and nothing else: it cannot charge anyone, read your customers or move money, and you can revoke it in two clicks without the banner stopping. Codes created this way keep working if you leave OfferBanner, because they are in your Stripe account, not ours. If you do not use Stripe, or you use WooCommerce coupons, type the code in by hand: the banner accepts any code, and the calendar still decides when it shows.
Run it from an AI agent
OfferBanner is an MCP server. Point Claude, or any MCP client, at https://offerbanner.com/mcp, approve it once in a browser tab, and your agent gets the same tools the dashboard uses: create the banner, schedule it, create the discount code, read the statistics. The agent door itself is included in the free plan; the tools that create a campaign window or a discount code need Pro, and say so when they are called.
Views and clicks
Counted per banner, so you can see whether a banner did anything.
03 — Checking
Check that the tag is installed
The dashboard fetches your homepage and looks for the tag, which is the same thing curl would tell you. If the tag is there and nothing shows, that is almost always correct: no campaign is scheduled for right now. If the tag is not there and you are sure you pasted it, purge the page cache — you are being served yesterday’s HTML.
To see a draft on the real site before anyone else does, add #ob-preview to your URL — https://yoursite.com/#ob-preview. The preview is not cached, not counted in your stats, and invisible to everyone without that fragment.
04 — Questions
Common questions
Do the discount codes work with WooCommerce?
The banner does. The automatic codes need one caveat. The codes we create are Stripe promotion codes, made in your own Stripe account. They are redeemable wherever Stripe collects the money — Stripe Checkout, a Payment Link, a Stripe-hosted subscription.
WooCommerce keeps its own coupons in its own table, and Stripe promotion codes are not those. For a Woo store, create the coupon in Marketing → Coupons as you always have, and type that code onto the banner. You still get one place that decides which banner shows, on which days, with which code on it — which is the part WooCommerce does not do.
Can I do it without installing another plugin?
Yes, on a classic theme, from a child theme. Add this to the child theme’s functions.php:
add_action( 'wp_footer', function () { ?>
<script src="https://offerbanner.com/embed.js" data-banner="YOUR_SITE_CODE" async></script>
<?php } );Editing the parent theme’s footer.php works today, but the next theme update overwrites it and the banner stops with no obvious cause. Use a child theme, or the plugin above.
What about the block editor?
A Custom HTML block accepts the tag and renders it. That is fine for trying it on one landing page, but not for a site-wide banner, because the tag only exists on the page you put it on. The Site Editor does not accept scripts, which is why block themes need the plugin path.
Will it slow the site down?
The tag is async, so it never blocks rendering, and the script is about 14KB gzipped, served from the edge. Compared with a banner plugin, nothing is added to PHP, nothing queries your database, and there is no plugin to keep updated.
What does the free plan include?
One banner at a time per site, on as many sites as you like, with a small “Powered by OfferBanner” badge on it. It shows to everybody, from the moment the page loads, and it starts and ends on whatever dates you book it for. Drafts are unlimited, and you can print a discount code you made in your own checkout. Pro adds country targeting, triggers, several campaigns running at once, and a Stripe code created and retired for you. The pricing page lists both plans in full.
Put a banner on your WordPress site
Free plan · No card