Troubleshooting
The website is not shown as secure with HTTPS (mixed content)
We assume your website is already set up to use https:// with its SSL certificate. Normally the browser shows it as secure:

But sometimes, even though the address starts with https://, the browser shows a warning, or the website looks "broken" because the stylesheets, images or JavaScript files do not load:

This is what is called mixed content: the page loads over HTTPS, but inside it has links to images, CSS, JavaScript or other resources that are requested over http://. Browsers block scripts and styles that arrive over HTTP, and until all resources load over HTTPS they do not show the website as secure.
Find the resources with http://
Open the website in Chrome or Firefox, press F12 and go to the Console tab. Reload the page: each problem resource appears with a "Mixed Content" warning and its full http:// address. We explain this in more detail in how to use the browser console.
With that list you know what needs fixing. The links are usually in:
- The application's database (page and post content, settings with the website's URL).
- The theme or template files, including the CSS (for example, a background image with
url(http://...)). - Resources from other websites (fonts, scripts, external images).
Fix it in WordPress
-
In Settings > General, check that WordPress Address (URL) and Site Address (URL) start with
https://. -
Change the old links in the database with the Better Search Replace plugin. In Tools > Better Search Replace:
- Search for:
http://tudominio.com - Replace with:
https://tudominio.com - Select all the tables.
- First do a pass with Run as dry run? ticked to see how many changes it will make, then untick it and run it.
Repeat with
http://www.tudominio.comif your website usedwww. Make a backup of the database first. This plugin respects WordPress's serialised data; do not do it with anUPDATEin phpMyAdmin, because you would break it.If you have SSH access, you can do the same with WP-CLI:
- Search for:
wp search-replace 'http://tudominio.com' 'https://tudominio.com' --all-tables --dry-run wp search-replace 'http://tudominio.com' 'https://tudominio.com' --all-tables
- Clear the WordPress cache (caching plugin) and the browser cache, and look at the console again.
If warnings remain, they usually come from the theme or a plugin with the address written in its code or CSS: fix it in that file or in the theme settings.
As a quick fix while you correct the source, the SSL Insecure Content Fixer plugin rewrites http:// links to https:// when serving the page. In its settings (Settings > SSL Insecure Content), start with the Simple level and move up to Content or Widgets if that is not enough.
Fix it on any other website
For any application (PrestaShop, Joomla, a hand-built website…), change the http:// links the console shows in the configuration, the database or the theme files.
In the meantime, you can ask the browser to load all the page's resources over HTTPS by adding this line at the top of the website's .htaccess file:
Header always set Content-Security-Policy "upgrade-insecure-requests"
It only works with resources that are also available over HTTPS. If an external website does not have HTTPS, that resource will still not load: download it and upload it to your hosting, or replace it with another one.
Check that it works
Open the website again with the console open: there should be no "Mixed Content" warnings left and the browser should show the connection as secure. Also check some internal pages, the contact form and, if it is a shop, the cart.
You may also find useful
- Chrome shows a controls icon instead of the HTTPS padlock Explains the controls icon Chrome uses for a secure connection and how to tell it apart from certifi...
- How to fix the cURL error 60 SSL certificate problem in WordPress How to diagnose and fix the WordPress cURL error 60 without disabling SSL certificate verification.
- Orders not confirmed after a Redsys payment Avoid unconfirmed orders with Redsys by checking the HTTPS callback and validating signature, amount...
- "An error occurred while sending the message" in the PrestaShop contact form Diagnose the contact form rejection and fix an old override only when it does not send contactform's...
Something wrong or out of date? Tell us and we will review it.