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.
- 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
- Add your site in the Pusharoo dashboard and copy your site key (
pk_…). - Upload
sw.jsto the folder that containswp-config.php, using your host’s File Manager or SFTP. Check thathttps://yoursite.com/sw.jsopens. - Add the snippet before
</head>:Block themes: Appearance → Editor → Patterns/Template parts → Header → Custom HTML block. Classic themes: a “headers and footers” plugin or your child theme’s<script src="https://pusharoo.com/sdk/pusharoo.js" data-site="pk_your_site_key" async></script>header.php. - Tell your caching plugin (WP Rocket, LiteSpeed Cache, W3 Total Cache): exclude
/sw.jsfrom caching and JS minify/combine, and excludepusharoo.jsfrom “delay JavaScript”. - 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 type | What to do |
|---|---|
| WP Rocket, LiteSpeed Cache, W3 Total Cache | Exclude /sw.js from caching and from JS minify/combine; exclude pusharoo.js from “delay JavaScript” |
| Cloudflare / CDN | Bypass cache for /sw.js and your manifest (Cache Rules) |
| Security plugins / firewalls | Allow /sw.js to be served as JavaScript; don’t block the Service-Worker-Allowed header |
| Other PWA or push plugins | Only 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.
Keep reading
Push notifications for online stores
Flash sales, back-in-stock, price drops and retargeting — without paying for ads.
Web push on iPhone and iPad, explained honestly
The Home Screen rule, the manifest you need, and how to guide iPhone visitors without friction.
The push opt-in prompt, done right
Two-step soft prompts, timing rules, copy that converts, and what never to do on page load.
Web push on Shopify: what works, honestly
Why Shopify blocks a root sw.js, and the workarounds that genuinely work.
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.