← Blog

How to add web push notifications to WordPress (2026 guide)

How-to · 4 September 2026

WordPress powers more than 40% of the web, and yet most WordPress sites have no direct channel to bring their readers back. Web push notifications solve exactly that: a reader accepts notifications once, and from that moment you can reach them in their browser even when they are not on your site, without asking for an email and without an algorithm deciding whether your content deserves to be seen.

In this guide we enable web push on a WordPress site from scratch, step by step. Time required: about ten minutes. Skills required: pasting two lines of code and uploading one file via FTP or your host's file manager.

What you need before starting

Three prerequisites, which almost every modern WordPress site already meets:

  1. The site must run on HTTPS. Web push only works over secure connections: it is a browser requirement, not a platform one. If your site is still on HTTP, this is the moment to fix it (certificates are free with Let's Encrypt and most hosts enable them in one click).
  2. Access to your site's files: FTP, your host's file manager, or a plugin that can upload files to the root.
  3. An account on a web push platform. In this guide we use Natom: the free plan goes up to 1,000 subscribers with unlimited pushes, which is plenty to get started.

Step 1: register the site on the platform

Create your account at natom.app/app, go to Sites and add your domain (a name and an address, nothing else). The platform generates two things: a JavaScript snippet identified by your site's unique key, and a file called natom-sw.js.

That file is the service worker: the component your reader's browser installs to receive and display notifications even when your site is closed. It is the technical heart of the whole system, and it is also the reason for step 3.

Step 2: add the snippet to your pages

The snippet is a single script tag:

<script src="https://cdn.natom.app/push.js?k=YOUR-KEY" async></script>

On WordPress you have three routes, from cleanest to quickest:

Option A: your theme (recommended). If you use a child theme, open footer.php and paste the snippet right before the closing </body>. It is the lightest solution: zero extra plugins.

Option B: a code-insertion plugin. Plugins like WPCode or Insert Headers and Footers have a "footer scripts" field: paste the snippet there and it applies to every page. Useful if you'd rather not touch the theme.

Option C: functions.php. For those who prefer code:

add_action('wp_footer', function () {
  echo '<script src="https://cdn.natom.app/push.js?k=YOUR-KEY" async></script>';
});

Whichever route you pick, one thing is non-negotiable: the snippet must be present on every page, because every page is a subscription opportunity.

Step 3: upload the service worker to your root

Download natom-sw.js from the dashboard (the Code button on your site's row) and upload it to the root of your domain, the same folder where wp-config.php lives. Once uploaded, the file must respond at:

https://yoursite.com/natom-sw.js

Open it in your browser to verify: if you see JavaScript code, you are set. If you see a 404, the file landed in the wrong folder (the most common mistake is uploading it inside /wp-content/ instead of the root).

Why the root? Browsers grant a service worker control only over pages "below" its location. From the root it controls the whole site; from a subfolder it would control that subfolder only.

Step 4: configure the opt-in prompt

Half the game is played here. The browser's notification permission is precious, and browsers punish sites that ask for it badly: the native request fired in a visitor's face on first landing gets declined by the vast majority, and a decline is forever (or close to it).

That is why the platform first shows your own customizable prompt, and only after a click the system request. From the Popup button in the dashboard you configure:

One golden rule from our experience: ask for the permission after the reader has received value, not before. The best moment is not the landing, it is the end of the first article they read.

Step 5: verify and send your first campaign

Open your site in a normal window (not incognito), accept notifications from the prompt, and check that the site's subscriber counter in the dashboard reads 1: that's you. Then use the Test push button on the site's row: if the notification lands on your desktop, the chain is complete.

At that point your first real campaign is a form: a title (roughly 60 visible characters), a short body, a destination URL, optionally an image. Send now or schedule. To sharpen the craft, see our guide on writing push titles people click.

The extra step that changes everything: audiences

With the snippet installed, you can immediately do something your readers will notice in a good way: tag interests. One line in your article template:

<?php foreach (get_the_category() as $cat): ?>
  <script>natom.tag('cat_<?php echo sanitize_title_with_dashes($cat->slug, '', 'save') ?>', '1')</script>
<?php endforeach; ?>

From that moment, sports readers profile themselves as sports readers, food readers as food readers, and you can send each group only its own topics. The typical result: higher CTR and far fewer unsubscribes. The full guide is here: audiences and segmentation.

Frequently asked questions

Do I need a dedicated WordPress plugin? No, and that is a feature: no plugin means no extra page weight, no updates to chase, no conflicts. The snippet weighs a few KB and ships from a CDN.

Does it work on iPhone? On iOS, web push arrives only if the user has added your site to their Home Screen (an Apple-imposed limit, identical for every platform). On Android and desktop it works everywhere.

What if I change theme? With option A you'll need to re-add the snippet to the new theme; with option B (plugin) it survives the switch. The service worker in your root is untouched by theme changes.

I already use another push service. Can I switch? Yes, and your readers will never see a new permission prompt: the permission belongs to your domain. The full procedure is in the migration guide.

Ten minutes of setup for a channel that, unlike social platforms, is yours forever: no algorithm standing between you and the people who chose to follow you.

Try Natom for free

Free up to 1,000 subscribers, unlimited pushes, live in 5 minutes.

Start for free