User Agents

Web browsers and everyday web tech, explained

Fix Chrome Mixed Content Warning: Step-by-Step

· 5 min read · Browsers

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Chrome’s mixed content warning appears when a secure HTTPS page loads resources (like images, scripts, or iframes) over insecure HTTP. This blocks or flags content, hurting site functionality and user trust. Fixing it means updating your site so all resources load over HTTPS. Here’s how to do it, step by step.

What You'll Need

  • Access to your website’s files (via FTP, cPanel, or a code editor).
  • Access to your site’s database (for updating URLs, if needed).
  • An SSL certificate installed and active on your domain.
  • If using a CMS like WordPress, admin access to the dashboard.

Step-by-Step

  1. Identify the mixed content. Open your site in Chrome, press F12 to open Developer Tools, and go to the Console tab. Look for warnings like “Mixed Content: The page at 'https://…' was loaded over HTTPS, but requested an insecure resource 'http://…'.” Note the exact URLs listed.
  2. Check all pages. Mixed content can appear on any page, not just the homepage. Use Chrome’s Network tab (also in Developer Tools) and filter by “Img”, “Script”, “Stylesheet”, or “XHR” to see all requests. Look for any with “http://” in the URL.
  3. Replace HTTP URLs with HTTPS. For each resource found, update the URL from http:// to https://. This can be done in your site’s code, database, or CMS settings.
  4. Use protocol-relative URLs (if you can’t update all at once). Instead of hardcoding “http://” or “https://”, use “//” (e.g., //example.com/image.jpg). This lets the browser automatically use the same protocol as the page. This is a temporary fix; it’s better to fully switch to HTTPS.
  5. Update your CMS settings. In WordPress, go to Settings > General and ensure both “WordPress Address (URL)” and “Site Address (URL)” start with https://. Also install a plugin like “Really Simple SSL” to help with mixed content fixes.
  6. Update your database. If your site has hardcoded HTTP URLs in posts or pages, you can run a search-replace in the database. Use a tool like phpMyAdmin or a plugin like “Better Search Replace”. Be careful: only replace the domain part, not the entire URL, to avoid breaking things.
  7. Force HTTPS on all resources. Add a redirect in your .htaccess file (Apache) or server config (Nginx) to send all HTTP traffic to HTTPS. For Apache, add this to .htaccess:
    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
  8. Test again. After changes, clear your browser cache and reload your site. Open Developer Tools again and check the Console and Network tabs for any remaining mixed content warnings.
  9. Use a mixed content scanner. Tools like Why No Padlock or JitBit's SSL Checker can crawl your site and list all mixed content issues. Run one after fixing to ensure nothing was missed.

Common Mistakes

  • Only updating the homepage. Mixed content can exist on any page, so check your entire site, not just the main URL.
  • Forgetting hardcoded URLs in CSS or JavaScript. Stylesheets and scripts may contain URLs that are not visible in the HTML. Use the Network tab to catch these.
  • Using a search-replace on the entire database without backing up. Always back up your database before running any replace, as errors can break your site.
  • Ignoring external resources. If you load content from third-party sites (like CDNs or embedded videos), those must also support HTTPS. If they don’t, you may need to replace them.
  • Not clearing cache. Browsers and caching plugins may serve old versions of your site, making it look like the problem persists.

Tips

  • Use a plugin if you’re on WordPress. “Really Simple SSL” and “Better Search Replace” can automate many fixes, but always review changes.
  • Enable HSTS (HTTP Strict Transport Security). Once your site is fully HTTPS, add the HSTS header to force browsers to always use HTTPS. This prevents future mixed content issues.
  • Set a Content-Security-Policy (CSP) header. Add Content-Security-Policy: upgrade-insecure-requests to your server headers. This tells the browser to automatically upgrade HTTP requests to HTTPS, which can fix many mixed content warnings without code changes.
  • Regularly audit your site. After major updates or adding new plugins, re-check for mixed content.

Troubleshooting

If the warning persists after following these steps:

  • Check if the resource actually supports HTTPS. Some older CDNs or external services may not. Try loading the HTTPS version in a new tab to see if it works. If it doesn’t, you’ll need to replace that resource.
  • Look for hardcoded URLs in your theme or plugin files. Use your text editor’s “Find in Files” feature to search for “http://” in your theme’s PHP files, CSS, and JavaScript.
  • Verify your SSL certificate covers all subdomains. If you have subdomains like cdn.example.com, ensure the certificate includes them, or use a wildcard certificate.
  • Check if your hosting provider has a “Force HTTPS” option. Some hosts offer this in their control panel, which can automatically redirect all traffic.
  • Use the “View Source” in Chrome. Right-click on your page and select “View Page Source” to see the raw HTML. Search for “http://” to find mixed content that might not appear in the console.

Frequently Asked Questions

What exactly is mixed content?

Mixed content occurs when a page loaded over HTTPS also fetches resources (images, scripts, iframes, etc.) over HTTP. Browsers block or warn about this because the insecure resources can be tampered with, compromising the security of the HTTPS page.

Will mixed content affect my SEO?

Yes, Google and other search engines may penalize sites with mixed content, as it degrades user security. Fixing it is important for ranking.

Can I just ignore the warning?

You can, but it’s not recommended. Chrome may block the resource entirely, causing parts of your site to break. Even if it loads, users may see a “Not Secure” warning in the address bar, which hurts trust.

Do I need to change all my internal links to HTTPS?

Yes, any internal links that point to HTTP URLs should be updated to HTTPS. This includes links in your navigation, content, and even your sitemap.

What if a third-party resource doesn’t support HTTPS?

If the resource is essential, you may need to find an alternative that does support HTTPS. For example, if an embedded video from an old service uses HTTP, you might need to switch to a different provider.

How long does it take for Chrome to stop showing the warning?

Once you fix the mixed content and clear your browser cache, the warning should disappear immediately. However, if you have a caching plugin, you may need to purge its cache as well.