Illustration of Wix push notifications using a backend function to serve the service worker Illustration of Wix push notifications using a backend function to serve the service worker

How to Add Web Push Notifications to Wix (and the Limits)

How to add web push notifications to Wix with a Velo HTTP function service worker, what you need first, and the limits to know about.

To add web push notifications to Wix, you need a Premium plan with a connected domain, a push tool’s script in Settings, Custom Code, and a service worker served through a Velo backend HTTP function. Wix doesn’t let you upload files to your site’s root, so that HTTP function workaround is what makes web push possible, and it has limits.

When I look at Wix push setups, the limits matter more than the steps. So below I explain what you need, how the workaround works, where it breaks, and when a different approach is the smarter call.

What do you need for web push on Wix?

You need a published Wix site on a Premium plan with a connected domain, a site that supports Velo backend code, and a push tool that lets you register the service worker yourself.

RequirementWhy it mattersSource
Premium plan and connected domainWix only allows custom code on a published site with a connected domainWix custom code docs
Velo or site code (Dev Mode)Needed to serve the service worker from a backend functionWix Editor and Wix Studio
Push tool with custom worker optionYou register the worker yourself, not the toolCheck your tool’s docs
HTTPSPush only works in secure contextsWix serves sites over HTTPS

One catch: Wix’s own docs say Wix Harmony sites don’t support site code. So the backend workaround below needs a Wix Editor or Wix Studio site.

Why is web push harder on Wix than on WordPress?

Because web push needs a service worker file served from your own domain, and Wix gives you no way to place a file such as /sw.js at your site root. On WordPress, a plugin simply writes that file to the server.

A service worker’s default scope is the folder it’s served from. To control the whole site from another path, the server must send the Service-Worker-Allowed header, which MDN explains. On Wix, you can’t set headers on static files, but you can set them in a backend HTTP function. That’s the opening the workaround uses.

How does the Velo HTTP function workaround work?

You create a backend function that returns the service worker code as JavaScript, with the Service-Worker-Allowed header set to /. Wix exposes backend HTTP functions at /_functions/ on your own domain, so the worker is same-origin.

Pushpad documents this exact pattern in its Wix setup guide. In outline:

  1. Open the Wix Editor and turn on Dev Mode.
  2. In the Backend section, add a file named http-functions.js.
  3. Export a get_ function, for example get_ServiceWorker, that returns the worker code.
  4. Set the Content-Type header to application/javascript and Service-Worker-Allowed to /.
  5. Publish, then open https://yourdomain.com/_functions/ServiceWorker to check it returns the code.

The worker code itself usually just imports your push tool’s worker script. Keep it short, because the function’s only job is serving that file with the right headers.

How do you add the push script to your Wix site?

Add the script in your dashboard under Settings, Custom Code, and load it on all pages. The script registers your HTTP function as the service worker with a scope of /, then starts the push tool.

  1. Go to Settings, then Custom Code, and add a new snippet.
  2. Paste code that calls navigator.serviceWorker.register with your /_functions/ path and scope set to /.
  3. Initialise your push tool and tell it not to register its own worker.
  4. Load the snippet on all pages, in the head.
  5. Publish, then subscribe from a private window to test.

Step 3 is where many tools fall short. If your push tool insists on loading its worker from /sw.js and offers no setting for a custom path, it won’t work on Wix. So check the docs before you pay.

Wix also notes that custom code snippets are tied to your domain, so changing your primary domain deletes them. Keep a copy of every snippet.

What are the limits of web push on Wix?

The workaround works, but it’s more fragile than a normal setup. These are the limits I’d weigh before relying on it.

LimitWhat it means for you
Paid plan onlyFree wixsite.com sites can’t add custom code
Not on Wix HarmonyHarmony doesn’t support site code, so no backend function
Tool must allow a custom worker pathMany push tools assume /sw.js
Platform changesIf Wix changes how HTTP functions or headers work, push can break
Domain changesA new domain means new subscribers and re-added snippets
iPhone needs a manifestHome Screen install needs a web app manifest too

Because of these limits, some push vendors simply say web push isn’t supported on Wix. If your tool doesn’t document Wix, assume it won’t work until you’ve tested it.

Does Wix web push work on iPhone?

Only partly. iPhone and iPad support web push from iOS 16.4, but only for sites added to the Home Screen, as WebKit explains. That install flow also expects a web app manifest, which faces the same hosting question on Wix.

So plan for most Wix subscribers to come from Android and desktop browsers such as Chrome, Edge and Firefox. For the full checklist, see how to get web push working on iPhone.

How do you test web push on Wix?

Check the service worker first, then the full subscribe-and-send loop. In Chrome, open DevTools, then Application, Service Workers, and confirm a worker from /_functions/ is active with scope /.

  1. Visit the site in a private window and accept the prompt.
  2. Confirm the subscriber appears in your push tool.
  3. Send a test notification and click it.
  4. Repeat on an Android phone.

If registration fails with a scope error, the Service-Worker-Allowed header isn’t reaching the browser. My explainer on the service worker for web push and the guide to web push notifications not showing cover the usual fixes.

When should you skip web push on Wix?

Skip it if you’re on a free plan, on Wix Harmony, or using a push tool that can’t register a custom worker. In those cases, an email signup or on-site announcement may serve you better for now.

Also consider where the site is heading. If push is central to your growth, a platform where you control the root, such as WordPress or your own hosting, makes push far simpler. My guide on how to add push notifications to a website covers those setups.

Where does LaraPush fit for Wix sites?

LaraPush is a self-hosted web push panel that works on sites that serve JavaScript, and its setup guide covers WordPress, regular websites, AMP, Blogger and iOS. It doesn’t document a Wix setup, so I wouldn’t pick it for a Wix-only site without testing the worker workaround first.

It’s a better fit if you also run sites where you control the server. You get unlimited subscribers and domains on one licensed server from $499 one-time (check current pricing). The trade-offs: you run the VPS and there’s no free plan. To compare hosted and self-hosted options, see my roundup of the best push notification services.

Frequently asked questions

Does Wix have built-in web push notifications?

Wix doesn’t offer browser web push for your site visitors as a standard site feature. To send browser push notifications, you add a third-party push tool through custom code and serve its service worker with a Velo backend function.

Can I add web push to a free Wix site?

No. Wix only allows custom code on a published site with a connected domain, and connecting a domain requires a Premium plan. Without custom code, you can’t add a push tool’s script or register a service worker.

Why does my Wix service worker fail with a scope error?

The worker is served from /_functions/, so its default scope is that path. To control the whole site, the response needs the Service-Worker-Allowed header set to /. Check that your HTTP function sets it and that you published the change.

Does the Wix workaround work on Wix Harmony?

No. Wix’s documentation says Harmony sites don’t support site code, and the workaround needs a backend HTTP function. On Harmony, you can still add custom code snippets, but you can’t serve a service worker this way.

Is web push on Wix reliable long term?

It works, but it depends on Wix keeping its HTTP function behaviour the same and on your push tool supporting a custom worker path. Test after major Wix changes, and keep your snippet and function code backed up.

Leave a Reply

Your email address will not be published. Required fields are marked *