How To Fix SSL And Mixed Content Errors In Hyper PWA
SSL and mixed content issues can prevent a Progressive Web App from working correctly. A PWA requires a secure connection to use important features such as the service worker, web app manifest, offline functionality, and push notifications.
If you see SSL warnings, insecure content warnings, or Hyper PWA is not working as expected after enabling it, follow the steps below to identify and fix the issue.
What Is an SSL or Mixed Content Error?
An SSL error usually means your website is not properly loading over a secure HTTPS connection.
A mixed content error happens when your website is loaded over HTTPS, but some resources are still being requested over HTTP.
For example:
- Your website loads from
https://example.com - But an image, JavaScript file, CSS file, font, manifest, or other resource loads from
http://example.com
Modern browsers may block insecure resources, which can affect PWA functionality.
1. Make Sure Your Website Uses HTTPS
First, open your website and check that it loads correctly using:
Your browser should display a secure connection indicator.
Also check both versions of your website:
http://yourwebsite.comhttps://yourwebsite.com
The HTTP version should automatically redirect visitors to HTTPS.
If HTTPS is not working, contact your hosting provider or install a valid SSL certificate for your domain.
2. Update Your WordPress Site URLs
Make sure your WordPress Address and Site Address use HTTPS.
Go to:
WordPress Dashboard → Settings → General
Check the following fields:
- WordPress Address (URL)
- Site Address (URL)
Both should use HTTPS:
After updating the URLs, save the changes and clear any website and browser cache.
Important: Always create a backup before changing your website URLs.
3. Redirect All HTTP Traffic to HTTPS
Your website should automatically redirect all HTTP requests to HTTPS.
For example:
http://yourwebsite.com/page
Should redirect to:
You can configure this through your hosting control panel, web server configuration, or CDN.
Many hosting providers also provide a Force HTTPS or HTTPS Redirect option.
4. Check for Mixed Content
Open your website in Google Chrome and inspect the page for insecure resources.
You can use the browser’s developer tools to check for errors.
Look for messages related to:
- Mixed Content
- Insecure resources
- HTTP resources requested from an HTTPS page
- Blocked scripts or stylesheets
Common resources that may cause mixed content include:
- Images
- CSS files
- JavaScript files
- Fonts
- Embedded videos
- API requests
- Third-party scripts
Update the insecure resource URLs from http:// to https:// whenever possible.
5. Check Your Theme and Plugins
Sometimes mixed content is caused by a WordPress theme or another plugin.
For example, a theme or plugin may contain hard-coded URLs such as:
http://yourwebsite.com/image.jpg
These URLs should be updated to:
If the issue started after installing or updating a plugin or theme, temporarily disable it and check whether the error disappears.
This can help identify the source of the problem.
6. Check Images and Other Media Files
Older websites may contain images and media files with HTTP URLs stored in the database.
Even if your website now uses HTTPS, these old URLs may still cause mixed content warnings.
You can update old URLs by using a WordPress search-and-replace tool or a trusted migration plugin.
For example, replace:
http://yourwebsite.com
with:
Always back up your database before performing a search-and-replace operation.
7. Check Your CDN or Proxy Configuration
If you use a CDN, caching service, or proxy such as Cloudflare, make sure it is configured correctly for HTTPS.
Check that:
- Your SSL certificate is active.
- Your origin server supports HTTPS.
- HTTPS is enabled for your domain.
- HTTP traffic redirects to HTTPS.
- Cached files are not serving outdated HTTP URLs.
After making changes, clear your CDN cache and test your website again.
8. Clear All Caches After Fixing the Issue
After fixing an SSL or mixed content issue, clear all relevant caches.
This may include:
- Browser cache
- WordPress cache
- Caching plugin cache
- Server cache
- CDN cache
- Existing service worker cache
Then open your website in a private or incognito window and test it again.
9. Test Your PWA Again
Once your website is fully loading over HTTPS and all mixed content issues are resolved, test your PWA again.
Check that:
- Your website loads securely over HTTPS.
- The HTTP version redirects to HTTPS.
- The web app manifest loads correctly.
- The service worker registers successfully.
- No mixed content warnings appear in the browser console.
- Offline functionality works as expected.
- PWA installation options are available when supported by the browser.
Still Having Problems?
Contact us, We will guide you further