WeWP
ComparePricingFeaturesContact UsLoginTry For Free
  • Knowledge Base
  • How to Fix "Not Secure" or "Not Private" Connection Errors
  • How to Add Cron Jobs
  • Connect to Your Server via SSH on Windows
  • Keeping Servers and Sites Secure
  • Troubleshooting Cloudflare Issues
  • Install WordPress Themes and Plugins with Composer
  • How To Fix Mixed Content Issue For WordPress
  • What Is a DDoS Attack and How to Prevent It?
  • How to Enable WordPress Debug Mode
  • How to Fix the “MySQL server has gone away” Error
  • How to Configure WP Mail SMTP Plugin to Send Emails
  • How To Fix the “HSTS Missing From HTTPS Server” Error
  • How to Check Your Domain's Expiration Date
  • How to Use and Serve WebP Images in WordPress
  • Email security best practices for using SPF, DKIM, and DMARC
  • What is a LEMP (Linux, Nginx, MySql, PHP) Stack?
  • Deploying Web Applications with NGINX HTTP Server
  • How to Configure WP Rocket Plugin for WordPress
  • How to Check SPF and DKIM Records with WeWP
  • Understanding FTP vs SFTP: Which Should You Use for Secure File Transfers?
  • What is a DMARC record and How to Set it Up?
  • How to Set Up Cloudflare’s Free CDN for WordPress
  • How to check your Ubuntu version (Using the command line and GUI)
  • How to Download Backups from WeWP panel
  • How to Change the PHP Version of Your Hosting Plan
  • Troubleshooting Cloudflare Universal SSL
  • How to Fix “Your Domain Is Not Pointing” Error
  • SSH vs SSL: What’s the Difference?
  • WordPress Search and Replace
  • How to Force HTTPS on WordPress Websites
  • How to Fix a Failed Lifetime SSL Installation
  • How to Redirect HTTP to HTTPS
  • How to Monitor System Processes Using htop Command
  • Varnish vs Nginx FastCGI Cache: Which is Best for WordPress?
  • What Is the Database information_schema on phpMyAdmin?
  • How to Disable WP-Cron for Faster Performance
  • How to fix the ERR_SSL_PROTOCOL_ERROR
  • How to fix the NET::ERR_CERT_AUTHORITY_INVALID error
  • How to Add Expires Headers in WordPress
  • How to fix the “There has been a critical error on your website” error
  • How to Fix ERR_QUIC_PROTOCOL_ERROR in Chrome Browser
  • What Is Localhost? And How Does It Apply to WordPress?
  • How to Fix a Mixed Content Warning on Your Website
  • How to Fix the "Connection Timed Out" Error in WordPress
Powered by GitBook
On this page
  • How to Fix a Mixed Content Warning
  • Conclusion

Was this helpful?

How to Fix a Mixed Content Warning on Your Website

PreviousWhat Is Localhost? And How Does It Apply to WordPress?NextHow to Fix the "Connection Timed Out" Error in WordPress

Last updated 2 months ago

Was this helpful?

What is a Mixed Content Warning?

A mixed content warning occurs when a website that is supposed to be loaded over a secure HTTPS connection contains resources—such as images, scripts, or stylesheets—that are still being loaded over an insecure HTTP connection. This can cause security issues and prevent a site from being fully secured. Browsers like Google Chrome, Mozilla Firefox, and Microsoft Edge display a mixed content warning to notify users of potential security risks.

Why Does a Mixed Content Warning Occur?

Even if your website has an SSL certificate installed, some elements might still be referenced using an HTTP URL. This often happens due to:

  • Old links hardcoded in the website’s source code

  • Content management system (CMS) settings not updated to HTTPS

  • External resources (images, scripts, or stylesheets) not available over HTTPS

  • Incorrect website configuration

To maintain security and prevent mixed content warnings, you should ensure all resources load over HTTPS.

How to Fix a Mixed Content Warning

Below are step-by-step instructions to resolve mixed content issues.

Step 1 - Check Your Website’s Configuration File

If the site’s URL is still set to HTTP, the website will try to load assets over an insecure connection.

How to Update the Configuration File:

  1. Open your website’s configuration file (e.g., wp-config.php).

Look for entries similar to the following: define('WP_HOME', 'http://yourwebsite.com');

  1. define('WP_SITEURL', 'http://yourwebsite.com');

  1. define('WP_SITEURL', 'https://yourwebsite.com');

  2. Save the file and refresh your website to check if the warning disappears.

Step 2 - Check the Website’s Source Code

If the issue persists, check your source code for hardcoded HTTP links.

Steps to Find and Replace HTTP Links:

  1. Open your browser's Developer Tools (press F12 or Ctrl + Shift + I in Chrome and Firefox).

  2. Navigate to the Console tab and look for mixed content warnings.

  3. Copy and search for the reported insecure URLs in your website’s source code.

  4. Open the corresponding file in a text editor or file manager and replace http:// with https://.

  5. Save the changes and refresh the website.

Step 3 - Use an Online Tool to Identify Mixed Content

  1. Enter your website’s URL and scan for mixed content issues.

  2. Check the results and fix the insecure links manually or update external resources to HTTPS versions.

Step 4 - Update Database URLs

If your site runs on WordPress or another CMS, mixed content may be caused by database entries.

Updating URLs in WordPress Database:

  1. Install and activate the Better Search Replace plugin.

  2. Run a search for http://yourwebsite.com and replace it with https://yourwebsite.com.

  3. Apply changes and verify if the issue is resolved.

Alternatively, run the following SQL query in phpMyAdmin:

UPDATE wp_posts SET post_content = REPLACE(post_content, 'http://yourwebsite.com', 'https://yourwebsite.com');

Step 5 - Force HTTPS with Nginx Configuration

For Nginx, add this directive to the configuration file:

add_header Content-Security-Policy "upgrade-insecure-requests";

Step 6 - Clear Cache and Test Your Website

After making these changes, clear your website cache to ensure the updates take effect:

  • Clear browser cache.

  • Clear website cache.

  • If using Cloudflare or another CDN, purge its cache.

Test your website in an incognito/private browsing window to confirm the mixed content warning is resolved.

Conclusion

A mixed content warning is a sign that some elements of your website are being loaded over an insecure connection, even when an SSL certificate is active. By following these steps—checking configuration files, updating hardcoded HTTP links, scanning with online tools, forcing HTTPS via Nginx and clearing cache—you can resolve the issue and ensure your website is fully secure.

Taking these steps will not only improve website security but also enhance SEO rankings and user trust, ensuring a safe browsing experience for your visitors.

Replace http:// with https://: define('WP_HOME', '');

A tool like can help identify insecure resources.

Visit.

https://yourwebsite.com
Why No Padlock
Why No Padlock