Skip to content
Platforms · 5 min setup

Web push for WordPress and WooCommerce

No heavy plugin, no settings maze. Upload one file, paste one line in your header, tell your caching plugin to leave it alone — done.

Updated By the Pusharoo team
In short
  • Upload sw.js to your WordPress root (the folder with wp-config.php).
  • Paste the snippet before </head> via the Site Editor, a header plugin or your child theme.
  • Exclude /sw.js from caching and minify; exclude pusharoo.js from “delay JavaScript”.
  • Works with WooCommerce and any theme.

Step by step

  1. Add your site in the Pusharoo dashboard and copy your site key (pk_…).
  2. Upload sw.js to the folder that contains wp-config.php, using your host’s File Manager or SFTP. Check that https://yoursite.com/sw.js opens.
  3. Add the snippet before </head>:
    <script src="https://pusharoo.com/sdk/pusharoo.js" data-site="pk_your_site_key" async></script>
    Block themes: Appearance → Editor → Patterns/Template parts → Header → Custom HTML block. Classic themes: a “headers and footers” plugin or your child theme’s header.php.
  4. Tell your caching plugin (WP Rocket, LiteSpeed Cache, W3 Total Cache): exclude /sw.js from caching and JS minify/combine, and exclude pusharoo.js from “delay JavaScript”.
  5. Test in Chrome and on your phone.

iPhone support on WordPress

For iPhone and iPad subscribers, add a small web app manifest and link it in your header — the docs include a copy-paste version. Then set data-ios-hint="true". Background: iOS web push explained.

Already using a PWA or another push plugin?

Only one service worker can control your pages. If a PWA plugin already registers one, import Pusharoo into it rather than adding a second (see existing service worker). If you’re replacing another push plugin, deactivate it first so its worker is removed.

Caching and security plugins

Plugin typeWhat to do
WP Rocket, LiteSpeed Cache, W3 Total CacheExclude /sw.js from caching and from JS minify/combine; exclude pusharoo.js from “delay JavaScript”
Cloudflare / CDNBypass cache for /sw.js and your manifest (Cache Rules)
Security plugins / firewallsAllow /sw.js to be served as JavaScript; don’t block the Service-Worker-Allowed header
Other PWA or push pluginsOnly one service worker per scope — use the two-line import in your existing worker or remove the old plugin

Notify readers of new posts automatically

WordPress publishes your feed at /feed/. Add it in Pusharoo under Integrations → Add a feed: the post title becomes the notification title, the excerpt the message, the featured image the large image, and a click opens the post. Choose automatic sending or drafts to review. Only posts published after you add the feed are sent, at most one per check, so importing old content never floods anyone. Category feeds (/category/news/feed/) let you send only one section.

Segment readers by category

Add a line to your theme’s single-post template to tag readers with the category they read — Pusharoo.tag('topic', 'recipes') — and build segments from those tags. A food blog can then send “new dessert recipe” only to dessert readers. Use the same approach to tag WooCommerce shoppers by product category (WooCommerce guide).

WooCommerce ideas

Back-in-stock alerts, flash sales and new arrivals work especially well. See ecommerce push for examples and UTM tracking.

Questions

Do I need a WordPress plugin for Pusharoo?

No. You upload one file and paste one snippet. A header/footer plugin is a convenient way to paste the snippet, but not required.

Why must sw.js be at the site root?

Browsers only let a service worker control pages within its own path, so a worker at the root can serve your whole site.

Does it work on WordPress.com?

Only on plans that allow uploading files to the site root and adding custom code. Self-hosted WordPress always works.

Does it work with WordPress multisite?

Yes. Add each site’s domain as a website in Pusharoo and use its own key. Sites on subdirectories of one domain share an origin, so treat them as one website with tags per subsite.

Will it conflict with a PWA plugin?

Only one service worker can control a scope. If a PWA plugin already registers one, add Pusharoo’s two-line import to that worker or choose one plugin.

More in Platforms: WooCommerce push notifications: setup and playbook · Magento 2 push notifications · Web push on Wix, Squarespace and Webflow · Web push notifications on BigCommerce · Web push notifications for PrestaShop · Web push notifications for Joomla · Web push notifications for Drupal · Web push notifications for Ghost blogs · All guides

Free for life. No limits.

Unlimited subscribers, campaigns and automations. No badges. About five minutes to install.