This article explains how to switch WordPress from HTTP to HTTPS.
Procedure
- Make sure your domain uses HTTPS. To do this, make sure your SSL certificate is active (check mark next to state):
- Force the redirection of the domain on HTTPS :
The following steps may be necessary if your WordPress was created or developed using HTTP and needs to be converted to HTTPS.
Setting Up HTTPS in WordPress
- First, in your WordPress administration, access to Settings -> General page.
- From here, you must update the WordPress Address (URL) and Site Address (URL) fields :
- Once you have done this, click on the Save changes button.
- Once the settings have been entered, WordPress will log you out and you will need to log in again.
Fixing Mixed Content in WordPress Database
The majority of incorrect URLs are images, files, embeds and other data stored in your WordPress database. The first step is to correct them.
To do this, you need to find all references in the database to your old website’s URL that begin with http and replace them with the URL of your new website that begins with https.
You can easily do this by installing and activating the Search & Replace Everything plugin.
- After activation, you need to visit the Tools -> WP Search & Replace page.
- In the Search for field, add the URL of your website with http. Then add the URL of your website with https in the Replace with field:
- Below, you will see all the tables in your WordPress database. You need to select all of them to perform a thorough check:
- Then click on the Preview Search & Replace button to see all the changes made by the plugin.
- Finally, click on the Replace All button:
- The plugin will now search your WordPress database for URLs starting with http and replace them with secure https URLs. This may take some time, depending on the size of your WordPress database.
Fixing Mixed Content Errors in a WordPress Theme
Another common cause of mixed content errors is the WordPress theme. Note that any WordPress theme worthy of the name and respecting WordPress coding standards will not cause this problem.
- First, you need to use your browser’s Inspect tool to find the resources and where they load.
- Next, you will need to find them in your WordPress theme and replace them with https. This will be a little difficult for most beginners, as you will not be able to see which theme files contain these URLs.