Mixed content errors are one of the most common problems that appear right after a site moves to HTTPS. The certificate may be installed correctly, but pages still load scripts, images, fonts, stylesheets, or AJAX requests over plain HTTP, which triggers browser warnings and can break layout or functionality. This guide gives you a repeatable way to find and fix mixed content after enabling HTTPS, with checks for WordPress settings, theme and plugin output, database content, CDN assets, and hard-coded URLs. It is written as a maintenance guide you can return to any time a migration, redesign, plugin change, CDN update, or domain adjustment causes your site to look secure in some places and not in others.
Overview
If you need to fix mixed content errors quickly, the core idea is simple: every resource on an HTTPS page must also load over HTTPS, or use a protocol-relative or relative path where appropriate. A page can have a valid SSL certificate and still show a browser warning if even one asset is called with an http:// URL.
Browsers typically classify mixed content in two broad ways:
- Active content such as JavaScript, CSS, iframes, and fetch requests. This is more likely to be blocked because it can affect page behavior.
- Passive content such as images, videos, and some media files. This may still trigger a warning even if the page partly loads.
The practical result is familiar: a lock icon disappears, a browser says the site is not fully secure, or some assets fail to load. In WordPress, this often happens after changing the site URL, installing an SSL certificate, moving hosting, switching a theme, enabling a CDN, or importing content from another environment.
Before you change anything, work through the problem in a deliberate order:
- Confirm the site URLs are set to HTTPS.
- Identify the exact assets still loading over HTTP.
- Determine whether the source is the database, theme, plugin, media library, CDN, or custom code.
- Apply a permanent fix at the source instead of relying only on temporary rewrite rules.
- Clear caches and test again.
For a safer workflow, especially on production sites with active traffic, it is worth testing changes on a staging copy first. If you need a controlled environment, see How to Create a Staging Site for WordPress and Test Changes Safely.
Start with your browser tools
The fastest way to locate mixed content is to open the affected page in a browser, launch DevTools, and inspect the Console and Network tabs. Look for blocked requests or warnings that name the exact resource URL. This tells you whether the problem comes from an image in post content, a script enqueued by a plugin, a stylesheet from a theme, or a request to a third-party service.
If you need a refresher on this workflow, How to Use Browser DevTools to Troubleshoot CSS, JavaScript, and Network Errors is a useful companion guide.
A quick WordPress mixed content checklist
- Check WordPress Address and Site Address under Settings > General.
- Confirm the database does not contain old
http://asset URLs. - Review theme files for hard-coded links.
- Review plugin settings that store asset, API, or callback URLs.
- Check page builders, widgets, menus, and custom HTML blocks.
- Check CDN, image optimization, and caching plugin settings.
- Verify that external services you depend on support HTTPS.
- Clear all caches after every fix.
Maintenance cycle
The most reliable mixed content fix is not a one-time patch but a maintenance routine. Even after a clean HTTPS migration, new mixed content can appear later when content editors paste full URLs, developers add custom code, plugins update settings, or assets begin loading from a different origin.
A practical maintenance cycle looks like this:
1. After enabling HTTPS
Run a full site check immediately after the SSL certificate is installed and the main site URLs are changed. Review key templates first:
- Homepage
- Main navigation pages
- Blog posts
- Landing pages
- Contact forms
- Checkout or account pages if relevant
- Media-heavy pages
If the certificate setup itself is incomplete, resolve that first. This article assumes HTTPS is already active and reachable. For certificate and redirect basics, see How to Set Up SSL Certificates: HTTPS Installation and Common Fixes.
2. After any migration or domain change
Mixed content often returns after moving a WordPress site to a new host, changing the primary domain, switching between subdomain and subdirectory structures, or cloning a site from staging to production. Imported databases commonly preserve older absolute URLs.
These changes deserve a fresh scan, especially if the previous environment used HTTP or a temporary domain. If you are planning or recovering from a move, How to Migrate a WordPress Site to a New Host Without Downtime can help reduce related issues.
3. During routine plugin and theme reviews
Whenever you install or update a plugin, switch a theme, or add a page builder block that references external assets, spot-check the front end. Mixed content can come from:
- Theme option panels that store logo URLs or background images
- Custom CSS with
background-image: url(http://...) - JavaScript variables containing hard-coded API endpoints
- Embedded forms, maps, videos, or font libraries
4. During launch and post-launch testing
HTTPS problems are easier to fix before a site launch than after users report them. Build mixed content checks into your launch process alongside redirects, forms, structured navigation, and performance testing. A reusable launch process reduces the chance that security warnings reach production. For broader pre-launch validation, review Website Launch Checklist: Everything to Test Before You Go Live.
5. On a recurring review schedule
Because this topic tends to reappear after changes, a simple review cycle is worthwhile. For actively maintained websites, a monthly or quarterly scan is usually enough. For lower-change sites, revisit the issue after major edits, infrastructure changes, or any report of a missing lock icon.
Think of mixed content as a maintenance item, not just a migration task.
Signals that require updates
You should revisit your HTTPS and mixed content setup whenever the site gives you any of these signals:
- The browser lock icon disappears on one or more pages.
- The browser says “Not secure” even though your certificate appears valid.
- CSS or JavaScript stops loading after enabling SSL.
- Images vanish or fail to load on older posts or product pages.
- Fonts, icons, or embedded media look broken after a theme or plugin update.
- Only some pages are affected, which often points to content-level or template-level hard-coded URLs.
- Problems started after changing CDN, caching, or optimization settings.
- Problems started after moving environments, such as staging to production.
These signals usually point to one of a small number of root causes. The goal is to identify which layer is responsible.
Check the site URL settings first
In WordPress, go to Settings > General and verify that both the WordPress Address and Site Address use https://. If these still use HTTP, many generated links may remain insecure.
Check server redirects
Make sure HTTP requests are redirected to HTTPS consistently. This does not solve mixed content inside page markup, but it prevents duplicate access patterns and reduces confusion. If your site still serves both protocols without a forced redirect, users and crawlers may encounter inconsistent behavior.
Check database content
Old absolute URLs inside posts, widgets, theme settings, or serialized option data are a common cause. Typical examples include:
- Image URLs inserted into older blog posts
- Customizer settings for headers and backgrounds
- Page builder content
- Plugin option tables
This is why database search-and-replace is often part of a WordPress mixed content fix. Be careful with serialized data and use a tool that handles WordPress structures correctly.
Check third-party assets
Some warnings are not caused by your server at all. A page may load a script, font, tracking pixel, iframe, or image from another provider that still uses HTTP. In that case, your options are to switch the URL to HTTPS, replace the service, self-host the asset where appropriate, or remove the dependency.
Common issues
This section covers the mixed content sources that appear most often, along with practical fixes.
1. Hard-coded HTTP URLs in theme files
Custom themes sometimes contain direct asset references in templates, header files, footer files, CSS, or JavaScript. Examples include:
<script src="http://example.com/js/app.js"></script>
<img src="http://example.com/wp-content/uploads/logo.png">Replace these with HTTPS URLs, root-relative paths, or platform functions that generate the correct scheme dynamically. In WordPress themes, this usually means using built-in functions instead of writing full URLs by hand.
2. Old URLs stored in posts, pages, and options
After an HTTPS switch, older content may still reference media over HTTP. This is especially common on long-running sites. A database search-and-replace can solve this, but it should be done carefully and ideally on staging first.
Focus on replacing your own domain’s HTTP URLs with HTTPS. Review the site after the replacement to ensure no malformed content was introduced.
3. Plugin-generated mixed content
Plugins may enqueue scripts, inject inline code, store external callback URLs, or output forms and widgets with fixed HTTP references. Common places to inspect include:
- Analytics or marketing plugins
- Social sharing tools
- Page builders
- Form plugins
- Security and optimization plugins
Disable the suspected plugin temporarily, reload the page, and see whether the warning disappears. If it does, review that plugin’s settings for old URLs or unsupported external resources.
4. CDN or asset host mismatch
If your images, scripts, or styles are served from a CDN, verify that the CDN endpoint supports HTTPS and that your site is requesting the CDN assets with HTTPS URLs. A common issue is that the main domain is secure but the CDN hostname is still configured with HTTP in a plugin or theme setting.
If you recently adjusted performance settings, this is a high-probability check. Performance and security often overlap. If you are reviewing broader optimization changes at the same time, How to Speed Up a WordPress Site: Performance Checklist You Can Reuse may help you isolate asset delivery changes.
5. CSS background images and font files
Mixed content is not always visible in page source because the insecure URL may live inside a stylesheet. Check custom CSS, child theme files, and theme options for background images, icon font files, or imported stylesheets using HTTP references.
DevTools is especially helpful here because it can show the exact stylesheet or request chain involved.
6. Insecure AJAX, API, and fetch requests
A page may load visually but still trigger warnings if JavaScript calls an HTTP endpoint in the background. Look for:
- AJAX URLs defined in localized scripts
- Custom fetch or XHR requests
- External APIs referenced in theme or plugin settings
Update endpoints to HTTPS where supported. If the external API has no HTTPS option, consider whether it should remain part of the site at all.
7. Temporary fixes that hide the real problem
Some site owners install an SSL helper plugin that rewrites content on the fly. This can be useful for diagnosis or short-term recovery, but it is better to fix the source permanently where possible. Rewrite plugins add another dependency and may leave the root cause unresolved in theme files, database content, or external service settings.
If you use one, treat it as a bridge rather than the final solution.
8. Cache confusion
You may correct the issue and still see warnings because a cache is serving older page output. Clear all relevant layers:
- WordPress cache plugin
- Server cache
- CDN cache
- Browser cache
- Optimization plugin cache for minified CSS or JavaScript
Then retest in a private browsing session.
9. Environment-specific paths after staging or migration
When a staging site, temporary domain, subdomain, or previous hostname was used during development, references may survive in templates or the database. This often happens after deployments and site moves. It can also happen when changing site structure, including subdomain and subdirectory decisions. For related planning, see Subdomain vs Subdirectory for SEO and Site Structure: When to Use Each.
A practical repair sequence
- Open the page and identify the exact insecure asset in DevTools.
- Decide whether the URL comes from content, theme, plugin, or external service.
- Update WordPress site URLs if needed.
- Replace old internal HTTP URLs in the database.
- Fix hard-coded theme or custom code references.
- Review plugin settings and disable suspects one at a time if necessary.
- Confirm CDN and asset host HTTPS support.
- Clear caches and test again.
- Retest a representative set of pages, not just the homepage.
When to revisit
The best time to revisit mixed content is before users notice it, but there are also clear moments when a review should be automatic. Use this section as a standing checklist.
Revisit after any of these changes
- Installing or renewing an SSL certificate
- Migrating hosting or changing infrastructure
- Moving from staging to production
- Changing domain, subdomain, or primary site URL
- Switching themes or major page builder settings
- Adding a CDN or changing CDN hostnames
- Installing optimization, caching, image, or security plugins
- Adding third-party embeds, scripts, fonts, or tracking tools
Run a scheduled review
For sites with regular releases, add a mixed content check to your maintenance calendar. A lightweight recurring process is usually enough:
- Open key templates in a private browser window.
- Inspect the Console and Network tabs for blocked or insecure requests.
- Check old content pages that rely on legacy media.
- Check pages using custom blocks, forms, or embeds.
- Clear and warm caches after making any changes.
Keep a short internal checklist
If you manage multiple sites, document the recurring checks in your deployment notes. Include:
- Canonical site URL should be HTTPS
- HTTP should redirect to HTTPS
- No internal assets should load over HTTP
- CDN hostnames should support HTTPS
- Theme and plugin settings should avoid hard-coded HTTP URLs
- Database replacements should be verified after migrations
Know when the problem is broader than mixed content
If the site still behaves unpredictably after fixing insecure asset requests, the underlying issue may be wider than HTTPS alone. Redirect loops, 404s, broken permalinks, or server misconfiguration can overlap with SSL migrations. In those cases, related troubleshooting guides may help, including How to Fix the WordPress 404 Error: Permalinks, .htaccess, and Server Checks.
Final action plan
When mixed content appears, do not guess. Inspect the page, identify the exact insecure request, fix the source, clear caches, and retest. If you treat HTTPS as an ongoing maintenance item rather than a one-time configuration task, mixed content becomes much easier to prevent and much faster to resolve. Save this process as part of your site operations checklist and return to it after every SSL change, migration, theme update, plugin rollout, or CDN adjustment.