Web Push Notifications for WordPress: A Complete Setup Guide
Add web push to WordPress with the free relaybell plugin — connect in one click, send a push on every new post, test it on your own browser, and fix the usual snags. Beginner-friendly.
Web push notifications let you reach visitors directly on their desktop or Android device — even after they've left your site. No email address, no app install. For a WordPress blog or store, it's one of the fastest ways to bring readers back when you publish something new.
This guide uses the free relaybell WordPress plugin, which does the fiddly parts for you: it loads the script, serves the background file browsers need, shows the opt-in prompt and sends a push when you publish. You don't need to edit any theme files or be a developer.
How web push works (30 seconds)
- A small script on your site asks the visitor whether they want notifications.
- A service worker — a tiny background file the browser keeps around — receives notifications even when your site isn't open.
- When a visitor says yes, their browser gives relaybell a private address for that device. relaybell stores it and delivers each notification you send.
Push needs HTTPS. Browsers refuse it on plain http:// sites (localhost is the only exception, for testing). Most hosts include free SSL now.
Step 1: Install the plugin
- In your WordPress admin, go to Plugins → Add New and search for relaybell (it's listed on WordPress.org).
- Click Install Now, then Activate.
Step 2: Connect in one click
Open Settings → relaybell and click Connect to relaybell. Sign in (or create a free account), approve the site, and you land back in WordPress, connected. There are no keys to copy.
From this moment, visitors see your subscribe prompt. You can change its wording, style and timing later in the relaybell dashboard under Audience → Subscribe prompt.
If the connection can't finish (some hosts block outgoing requests), open Advanced at the bottom of the same page and enter your Project ID (dashboard → Install) and an API key (dashboard → Settings → Developer → API keys) by hand.
Step 3: Turn on "Send on publish"
This step is easy to miss: "Send on publish" is off by default, so nothing goes out when you publish until you switch it on.
In Settings → relaybell → Publishing:
- Tick Send on publish ("Send a push notification when I publish new content").
- Under Which post types, pick what should trigger a push (posts only, by default).
- Click Save settings.
The push uses the post's title, the first few words of the text, its featured image and a link to the post. It goes out once, when a post is first published — editing a published post later doesn't send it again. Scheduled posts are pushed when they go live.
Use either this setting or the dashboard's Automations → Announce new blog posts (which reads your RSS feed) — not both, or subscribers get every post twice.
Step 4: Try it on your own browser
Still on the settings page:
- Click Subscribe this browser and allow notifications when your browser asks. This browser becomes your test device.
- Click Send test push. Test pushes go only to your own test devices — never to your subscribers.
You should see the notification within a few seconds. If you don't, the page tells you what it found and what to try, for example that Windows or macOS is hiding notifications, or that notifications are blocked for this site in your browser.
Step 5: Read the status panel
The Status box at the top of the settings page checks the things that most often stop push from working:
- Connected to … — N subscribers: the plugin can reach relaybell with your site's key.
- Site uses HTTPS: needed for push at all.
- The relaybell script loads in your browser: if not, an ad blocker, firewall or security plugin is blocking it.
- Service worker registers: if not, the panel says why — often a hosting firewall, a security or caching plugin, or password protection on a staging site blocking the plugin's background file.
- This browser: whether this browser is subscribed and set as your test device.
Click Re-check after you change anything.
Step 6: Clear your page cache
If you use a caching plugin (WP Rocket, LiteSpeed Cache, W3 Total Cache and so on), a CDN such as Cloudflare, or your host's built-in cache, clear it after connecting. Cached pages were saved before relaybell was installed, so visitors keep getting a copy without the prompt until the cache is refreshed. Do the same if you ever disconnect and connect the site again.
Step 7: Verify your relaybell email
When you create a relaybell account with an email and password, we send you a link to confirm the address. Until you click it, new posts aren't pushed to your visitors. "Send test push" still works in the meantime, which is why this one catches people out. If you can't find the email, check spam, or open the relaybell dashboard and click Resend email. Accounts made with Google or GitHub are already verified.
Without the plugin (for developers)
If you'd rather wire it up by hand, here is everything the plugin does, with the real values. Don't combine this with the plugin — you'd load the script twice and every new post would be pushed twice.
1. Load the script on every page. Your Project ID is in the dashboard under Install. In a child theme's functions.php:
add_action('wp_footer', function () {
?>
<script src="https://relaybell.com/relaybell-sdk.js"></script>
<script>
RelayBell.init({ projectId: 'YOUR_PROJECT_ID', apiBase: 'https://relaybell.com' });
</script>
<?php
});
Keep apiBase — without it the script looks for relaybell on your own domain.
If a speed or caching plugin delays scripts, RelayBell may not exist yet when that second line runs. In that case print these two lines inside the same wp_footer function instead — the options go first, and relaybell starts itself as soon as its script loads:
<script>window.relaybellInit = { projectId: 'YOUR_PROJECT_ID', apiBase: 'https://relaybell.com' };</script>
<script src="https://relaybell.com/relaybell-sdk.js"></script>
2. Put the service worker at your site root. Download sw.js and upload it to your WordPress root folder (the one with wp-config.php), so it opens at https://yoursite.com/sw.js. Exclude it from your caching and security plugins' rules if it won't load.
3. Send on new posts. Create an API key in the dashboard under Settings → Developer → API keys and keep it on the server — never put it in a page. This sends one push when a post is first published:
add_action('transition_post_status', function ($new_status, $old_status, $post) {
// Only a brand-new publish of a normal post: not updates, pages or revisions.
if ($new_status !== 'publish' || $old_status === 'publish' || $post->post_type !== 'post') {
return;
}
$res = wp_remote_post('https://relaybell.com/api/v1/notifications', [
'headers' => [
'Authorization' => 'Bearer YOUR_API_KEY',
'Content-Type' => 'application/json',
],
'body' => wp_json_encode([
'title' => html_entity_decode(get_the_title($post), ENT_QUOTES),
'body' => wp_trim_words(wp_strip_all_tags($post->post_content), 20, '…'),
'url' => get_permalink($post),
'image' => get_the_post_thumbnail_url($post, 'full') ?: null,
]),
'timeout' => 15,
]);
// relaybell answers 202 when the send is accepted. Anything else is logged to
// wp-content/debug.log (with WP_DEBUG_LOG on) — e.g. 403 email_not_verified.
if (is_wp_error($res) || wp_remote_retrieve_response_code($res) !== 202) {
error_log('relaybell push failed: ' . (is_wp_error($res) ? $res->get_error_message() : wp_remote_retrieve_body($res)));
}
}, 10, 3);
The Content-Type: application/json header matters: without it the request arrives empty and is refused. The full list of fields (segments, scheduling, buttons and more) is in the developer docs.
Tips to get clicks, not blocks
- Ask in context. A soft prompt ("Want new-post alerts? Yes / Not now") after a few seconds or a scroll beats the browser's own question on the first second of the first visit.
- Say what they'll get and how often — "1–2 alerts a week when we publish."
- Segment when you can — send food posts to food readers, deals to shoppers. Targeted sends out-perform blasts on click-through.
- Keep titles short and specific, and don't over-send. One or two pushes a week keeps unsubscribes low.
- Always link straight to the new post, not your homepage.
That's the full loop: install, connect, turn on Send on publish, test, clear the cache and verify your email. Once it's set up, every new post quietly pulls returning readers back — for free.
Ready to try web push? Get started with relaybell — free to deliver, set up in minutes.