How to Fix Mixed Content Warnings in WordPress
A WordPress website can have a valid SSL certificate and still display mixed content warnings. This happens when the page itself loads over HTTPS, but one or more resources—such as images, stylesheets, scripts, fonts, videos or iframe content—are requested over insecure HTTP. Browsers may block those resources or show a warning to visitors.
The problem is common after moving a site from HTTP to HTTPS, changing domain names, restoring a backup, or installing a plugin that stores absolute URLs. It can affect a small business website in Brisbane just as easily as a large WooCommerce shop serving customers across Sydney, Melbourne and regional Australia.
A mixed content warning is more than a cosmetic issue. Blocked JavaScript can break menus, payment screens or forms, while insecure images and stylesheets can make a site look unreliable. The fix is usually a combination of checking the WordPress address, updating stored URLs, correcting hard-coded links and clearing every relevant cache.
Understand What the Browser Is Blocking
Mixed content occurs when an HTTPS page requests a resource through HTTP. For example, the page may be loaded from https://example.com, while an image is still referenced as http://example.com/wp-content/uploads/logo.png. The browser treats the page as secure but the resource as insecure.
Browsers generally divide mixed content into passive and active categories. Images, audio and video may be allowed with a warning, although the browser can still upgrade or block some requests. Scripts, stylesheets, fonts, AJAX calls, web fonts, iframes and other active resources are more likely to be blocked because they can change the page or execute code.
Open the affected page in Chrome, Edge or Firefox and use the developer tools console. Look for messages containing “Mixed Content”, “blocked”, “insecure request” or an HTTP URL. The console often identifies the exact file, plugin, theme or line of code responsible. Test the page in a private window as well, because an old browser cache can hide the result of a repair.
Some warnings are generated by external services. A chat widget, map, advertising script, video embed or payment integration may still use an HTTP endpoint. In that case, changing your WordPress media URLs will not be enough; the third-party service must support HTTPS or be replaced.
Locate Insecure URLs Across the Site
Start with the two site URL settings in Settings > General: WordPress Address (URL) and Site Address (URL). Both should use https:// and normally should match the preferred version of your domain. If one setting still uses HTTP, WordPress can continue generating insecure links for feeds, login pages, REST responses and other functions.
Before making database changes, create a complete backup of the database and files. A staging copy is safer for a busy website, particularly a WooCommerce store with active orders. Australian businesses often work with managed WordPress hosts in Sydney or Melbourne, and many of these hosts provide staging tools that make testing the change straightforward.
Search the database for the old HTTP address. Useful locations include post content, widget settings, theme options, custom fields, menu URLs, form configurations and plugin tables. A search-and-replace tool that understands serialized data is important because WordPress stores some settings in a format where changing string lengths manually can corrupt the value.
WP-CLI is suitable for administrators who have shell access. A typical command looks like this:
wp search-replace 'http://example.com' 'https://example.com' \
--all-tables-with-prefix --skip-columns=guid --dry-run
Review the dry-run output before applying it. The guid column is normally excluded because WordPress treats it as a permanent identifier, not a display URL. If the site uses a subdirectory, alternate domain, or staging hostname, adjust the search strings carefully and check the results on staging first.
Repair WordPress Core, Themes and Plugins
After updating the database, inspect theme files and custom code for hard-coded HTTP references. Common examples include http:// values inside functions.php, header templates, CSS files, JavaScript files, custom widgets and child-theme assets. Use WordPress functions such as get_template_directory_uri(), get_stylesheet_directory_uri() and wp_enqueue_style() instead of writing full asset URLs by hand.
Stylesheets can contain hidden mixed content that does not appear in the page HTML. Check CSS for url(http://...) declarations involving background images, web fonts or imported stylesheets. A browser console may identify the CSS file rather than the original setting, so search the theme and custom CSS directly when the source is unclear.
Plugins can store their own URLs independently of WordPress core. Page builders, sliders, galleries, SEO tools, contact forms and caching plugins may have settings that still refer to the old domain. Open each relevant settings screen and save the HTTPS version, then regenerate assets if the plugin offers that option.
If a plugin loads a resource from its own HTTP-only server, do not simply disable certificate checks or use an insecure workaround. Contact the developer, update the plugin or find a maintained alternative. A practical WordPress reference such as Android tutorials can also be useful when checking how mobile browsers and embedded resources behave across different devices, although the underlying HTTPS requirement remains the same.
External embeds deserve special attention. Replace old YouTube, Vimeo, Google Maps, social media and analytics snippets with their HTTPS versions. Some providers now supply protocol-relative or automatically secure embed codes, but explicit HTTPS URLs are easier to audit and maintain.
Check Media, Redirects and Cached Files
Media library records often retain the old domain after an SSL migration. Use the browser inspector to identify insecure image, video and document requests, then update the attachment or content that generates each URL. Do not assume that uploading the same file again will fix references already saved in posts, widgets or page-builder templates.
The server should redirect HTTP requests to HTTPS with a permanent redirect, commonly a 301. A redirect is useful when somebody follows an old bookmark or search result, but it is not a complete mixed-content solution. If an HTTPS page contains an HTTP image, the browser may block the request before the redirect can make it secure.
A basic Apache rule may look like this:
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Use the equivalent redirect setting in Nginx, your hosting control panel or a reverse proxy. Avoid adding several competing redirect rules, because redirect chains can slow the site and cause loops. Cloudflare and similar services can also affect SSL mode, so make sure the connection between the proxy and the origin server is encrypted where appropriate.
Clear every caching layer after making changes. This can include a WordPress caching plugin, server-side page cache, CDN cache, object cache and browser cache. A CDN may continue serving an old CSS or JavaScript file containing HTTP references even after the origin site has been repaired.
Performance settings can create a related problem when they rewrite asset URLs or combine files. If you are also reviewing image delivery, the guide on lazy loading images explains a separate optimisation technique. Keep performance changes isolated while troubleshooting, so you can tell whether a cache or optimisation feature has reintroduced the warning.
Verify the Repair and Prevent New Warnings
Test more than the homepage. Check the login page, contact forms, checkout, account area, search results, pop-ups and any page that uses a different template. For an Australian shop, test delivery calculators, postcode fields and payment flows with an Australian postcode and currency settings. A secure homepage does not prove that a checkout script or account form is secure.
Use developer tools with the console and Network tab open. Filter requests by http://, reload the page and inspect blocked resources. Also test with a mobile connection rather than relying only on office Wi-Fi. Visitors using the NBN, a mobile network in regional Queensland or public Wi-Fi in a café may receive different cached assets from the same CDN.
Useful browser and server checks include:
- View source and search for
http://. - Inspect blocked requests in the Network tab.
- Check redirects with
curl -I. - Review the SSL certificate for every hostname.
Once the visible warnings are gone, scan the site with a reputable SSL checker and review the security headers. A Content Security Policy with a reporting mode can reveal insecure requests that are missed during manual testing. The upgrade-insecure-requests directive may help browsers upgrade old links, but it should support proper URL repairs rather than replace them.
Keep a short maintenance checklist for future deployments:
- Use HTTPS staging and production URLs.
- Avoid hard-coded domains in theme code.
- Update plugins before major site changes.
- Purge page, object and CDN caches after migrations.
Check new content before publishing, especially HTML pasted from old documents or third-party services. Page builders may save full URLs behind buttons, background images and responsive settings, while imported demo content can restore the original developer’s HTTP domain. A quick console check after a redesign can catch the issue before customers see it.
Finally, confirm that the certificate covers every hostname visitors may use, including www, the bare domain and any subdomain used for forms, images or APIs. Renewals, DNS changes and hosting migrations can create a fresh warning even after an earlier repair was successful. Keeping domain settings, redirects, WordPress URLs and third-party integrations aligned gives the site a reliable HTTPS foundation.