1. Home
  2. Blog
  3. Progressive Web App (PWA)

Fix a WordPress PWA Service Worker That Will Not Register

Every part of a WordPress PWA hangs off one file. The install prompt, offline pages, background sync and push notifications all need a working service worker, and when that file fails to register, they all stop together. Nothing on the front end tells you. The site looks normal, visitors just never see the install banner, and your push subscriber list stays empty.

This guide walks through a WordPress service worker not registering, in the order the causes actually turn up, using the checks built into Progressify. Most fixes take a minute once you know which of the six or seven usual suspects you are dealing with.

Why this one file matters so much

Progressify registers a service worker built on Workbox. It sits between your site and the network, and every request from an installed app goes through it. The Progressify documentation is blunt about what happens if it is missing: a service worker that fails to register silently disables offline support, install prompts and push notifications across the whole site.

So if any of these sound familiar, start here rather than in the individual feature settings:

  • The install banner or overlay never appears, even in a fresh browser.
  • The PWA works on your laptop but not on the live domain.
  • Offline mode shows the browser’s own error page instead of your content.
  • Nobody ever subscribes to push notifications, including you.

The troubleshooting docs put it in one line: almost every Progressify problem traces back to the site not being on HTTPS, the service worker not registering, or a cache serving something old. The first two are the subject of this post.

Step 1: Confirm HTTPS on the real domain

Browsers refuse to register a service worker on an insecure origin. The address bar must show https:// with a valid certificate. Without it, there are no install prompts, no offline caching and no push notifications, and no setting in any plugin can change that.

There is one exception, and it causes a lot of confusion. Browsers exempt localhost from the HTTPS requirement. A PWA can appear to work perfectly on a local development site and then fail on the real domain. If you built and tested locally, test again on a staging site with a real certificate before you conclude the plugin is broken.

Also check for mixed setups. A site that loads over HTTPS but has an expired certificate, or a certificate for the wrong hostname (for example www versus the bare domain), still counts as insecure to the browser.

Step 2: Ask the browser what it sees

Open your site in Chrome or Edge, open developer tools, and go to Application > Service Workers. You want to see one service worker listed for your site, shown as activated.

  • Nothing listed. Registration never happened or failed. That is your problem, and the steps below find out why.
  • One listed, activated. Registration is fine. If features still misbehave, look at caching or the manifest instead.
  • More than one, or one from a different plugin. Jump to Step 6.

While you are in the same panel, open Manifest. It shows the values the browser actually read and flags anything invalid, including icons that failed to load. A broken manifest does not stop the service worker, but it does stop the install prompt, so it is worth ruling out at the same time.

Then open the Console tab and reload. A service worker that fails to register usually leaves an error there, and the wording (a 404, a wrong MIME type, a syntax error) points straight at one of the next steps.

Step 3: Load the service worker URL directly

Progressify serves the service worker from a query variable on your home URL:

https://example.com/?progressify_serviceworker=1

Open that address in a normal browser tab. The docs say exactly what you should get: JavaScript. Not HTML, and not a 403.

What you seeWhat it usually means
A page of JavaScriptThe URL is fine. Move on to Step 4.
Your homepage, or any HTML pageSomething in front of WordPress is answering instead, most often a page cache or a redirect rule
A 403 or a firewall block pageA security plugin, a web application firewall or a CDN rule is blocking the request
A login pageA maintenance, coming soon or private site plugin is intercepting visitors

The browser will not register a script that comes back as HTML or as an error, so any result other than JavaScript explains the failure on its own.

The fix for the last three rows is the same idea: let the two Progressify URLs through. The Progressify conflict table lists security plugins that block the service worker request or return HTML, and the answer is to allow ?progressify_serviceworker=1 and ?progressify_manifest=1. In a security plugin that usually means an allowlist entry. On a CDN it means a rule that bypasses the firewall and the cache for those two query strings.

Step 4: Make sure the generated file exists

Behind that URL is a real file. On activation, Progressify writes the service worker to:

/wp-content/uploads/progressify/scripts/serviceworker.js

Check that it exists. If it does not, the cause is almost always permissions: the uploads directory has to be writable for Progressify to create it. The good news is that regeneration is built in. Saving the Progressify settings screen rebuilds the file from your current settings, and the same is true of the generated icons and splash screens.

If you prefer to do it from a script, the Progressify REST API has an endpoint for exactly this, POST /service-worker/generate, which rebuilds the file and is documented for use when the scorecard reports it missing. Like the other administrative endpoints it needs the manage_options capability.

If saving the settings does not bring the file back, look at the uploads folder itself. Some hosts lock it down, some deployment setups replace it on every release, and some security hardening guides make it read-only. Any of those will stop the file from being written.

Step 5: Keep page caches away from the PWA files

Page caching is the most common cause of a service worker that registered once and then started behaving strangely. Progressify’s FAQ covers it directly: if you run a caching plugin, exclude ?progressify_manifest=1 and ?progressify_serviceworker=1 from the page cache so both are always served fresh.

Two things go wrong when you do not:

  1. A cache that ignores query strings can serve your homepage HTML at the service worker URL. That is the “HTML instead of JavaScript” row from Step 3.
  2. A cache can keep serving an old copy of the service worker after you change settings, so your changes never seem to take effect.

Remember that there may be several caches between a visitor and WordPress: the service worker’s own cache, a page cache plugin and a CDN. When content looks stale, clear them from the outside in.

If you also run Lightify, you do not need to do anything special. When Progressify is active it owns the service worker, and Lightify’s browser cache section is disabled automatically so that two service workers never compete for the same scope.

Step 6: Run one PWA plugin, not two

Two PWA plugins on one site means two service workers competing for the same scope. The browser can only have one in control of a given scope, so the result is unpredictable: one plugin’s offline page, the other plugin’s caching rules, and install prompts that come and go.

The Progressify conflict table is short on this point: run one PWA plugin only. If you are switching from another PWA plugin, deactivate it, then unregister its service worker in Application > Service Workers and reload, so the old registration does not linger in your own browser while you test. Visitors’ browsers will pick up the new registration as they return.

Theme features can do the same thing quietly. Some themes and app builders ship their own service worker. If DevTools shows a service worker you did not expect, find out where it comes from before you go any further.

Step 7: Check any custom service worker code

Progressify exposes a progressify_serviceworker filter for developers who want to add their own code to the generated file. It is powerful, and it has one sharp edge. A JavaScript syntax error in your addition stops the whole file from registering, and the console will say so.

The documentation gives three rules for using it safely:

  • Append, do not rewrite. The value is the complete service worker source (Workbox followed by Progressify’s own listeners, routing and cache cleanup). Add to the end of the string rather than replacing it.
  • Re-save after changing it. The file is generated, not assembled on every request, so a code change does nothing until the settings screen is saved or the generate endpoint is called.
  • Verify in DevTools. After every change, check Application > Service Workers to confirm the worker still registers.

If the service worker stopped registering right after someone added a snippet to a theme or a code snippets plugin, remove the snippet, re-save, and confirm registration comes back before you debug the snippet itself.

Step 8: Test like the browser, not like an admin

A stale registration in your own browser can make you chase problems that are already fixed. The Progressify docs suggest a testing routine worth following every time:

  • Test in a private window or a fresh browser profile, so no earlier registration or dismissed prompt is in play.
  • Use Application > Storage > Clear site data between attempts.
  • Test install prompts on a real Android phone. Chrome on a device behaves differently from a desktop emulator, so do not conclude something is broken from the emulator alone.

Read the scorecard last

Once registration works, open Progressify > Overview. The PWA scorecard rates your setup out of 100, and the service worker is one of the items worth 10 points, alongside HTTPS, the app icon, the app name and the generated assets. If the service worker or the icons are missing, the scorecard flags it.

The score itself is free. The itemized list of exactly which checks are failing is a Pro feature, and it is the quickest way to confirm nothing else is missing after a fix like this.

A quick reference

SymptomLikely causeFix
Works on localhost, fails liveHTTPS exemption for localhostTest on staging with a real certificate
Service worker URL returns HTMLPage cache or redirectExclude both Progressify URLs from the cache
Service worker URL returns 403Security plugin, firewall or CDNAllow ?progressify_serviceworker=1 and ?progressify_manifest=1
File missing in uploadsUploads folder not writableFix permissions, then re-save settings
Stopped after a code changeSyntax error in the filterRemove the addition, re-save, then fix it
Two workers in DevToolsAnother PWA plugin or theme featureKeep one, unregister the other
Changes never show upStale cache or old registrationClear caches outside in, clear site data

What comes back once it registers

When the service worker is in place, everything that depends on it starts working again without further changes: the install prompts and overlays you configured, offline access to pages visitors have already opened, your offline fallback page, background sync for forms and comments, and push notifications sent straight from wp-admin with no third-party service.

That is also why it is worth a two minute check after any change to hosting, security plugins, CDN rules or caching. A firewall rule added for an unrelated reason can switch your whole PWA off without a single error on the page.

Where this sits in Progressify

The service worker, the manifest, HTTPS checks, the PWA score and the regeneration on save are all in free Progressify. Pro adds the itemized scorecard, the extra install overlays, the app-like interface, offline forms and the push automations, and it comes with every other DaftPlug plugin under one membership. See pricing for the plans.

If your service worker is registered and the problem is that edits do not show up, the next thing to look at is your caching strategy. We covered that in setting up a branded offline page and cache rules for your WordPress PWA.