PWA Setup in WordPress Using Blocksy Content Blocks (Simple Guide)

Progressive Web App (PWA) Setup Using Simple Code and Blocksy theme content block

This guide shows how to make your website installable like an app using a simple PWA setup. No external services are used. Every step below clearly tells you where to create files and where to paste code.


Step 1 — Create manifest.json

Where: File Manager or Hosting Panel → open public_html (your WordPress root folder)

Action: Create a new file named manifest.json

Paste this inside the file:


Step 2 — Upload App Icons

Where: WordPress Dashboard → Media → Add New

Action:

  1. Upload a 192×192 PNG icon
  2. Upload a 512×512 PNG icon
  3. Click each image and copy its URL
  4. Replace paths in manifest.json

Example:


Step 3 — Add Manifest to WordPress

Where: WordPress → Appearance → Theme File Editor → open functions.php

Scroll to the very bottom of the file

Paste this code at the bottom:


Step 4 — Create Service Worker (sw.js)

Where: File Manager → public_html

Action: Create a new file named sw.js

Paste this inside:


Step 5 — Register Service Worker

Where: functions.php (same file as Step 3)

Scroll to the bottom again

Paste this below previous code:


Step 6 — Create Offline Page

Where: WordPress Dashboard → Pages → Add New

Title: Offline

URL will be: /offline/

Content:

Publish the page.


Step 7 — Create Install Popup (Blocksy)

Where: Blocksy → Content Blocks → Add New

Settings:

  • Type: Popup
  • Trigger: After X Time
  • Time: 5 seconds
  • Visibility: Mobile Devices Only

Inside the popup editor, add a Custom HTML block and paste:

Publish the popup.


Step 8 — Add Install Logic

Where: functions.php

Scroll to the bottom

Paste this below all previous code:


Final Result

  • Popup appears after 5 seconds (only on mobile)
  • User clicks Install App
  • Browser shows install prompt
  • App installs on home screen
  • Offline page works when internet is unavailable

Important Notes

  • Works best on Android Chrome
  • iOS requires manual “Add to Home Screen”
  • Your website must use HTTPS
  • If your WordPress root is not public_html, use your actual root folder

This is a simple and stable PWA setup without external dependencies.

Frequently Asked Questions

Does this PWA setup require a plugin?

No. This setup uses simple code without any WordPress plugin.

Does it work on all devices?

It works best on Android Chrome. On iOS, users must manually use “Add to Home Screen”.

Why is HTTPS required for PWA?

Service workers only run on secure (HTTPS) websites. Without HTTPS, PWA features will not work.

Why is the install popup not showing immediately?

The browser controls when the install prompt is available. It appears only after certain conditions are met.

Can I use this without Blocksy theme?

Yes. Blocksy is used only for popup convenience. The PWA setup works with any theme.