1. Home
  2. CMS/Applications
  3. How to Switch WordPress From HTTP to HTTPS

How to Switch WordPress From HTTP to HTTPS

This article explains how to switch WordPress from HTTP to HTTPS.

Procedure

  1. Make sure your domain uses HTTPS. To do this, make sure your SSL certificate is active (check mark next to state):
  1. 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

  1. First, in your WordPress administration, access to Settings -> General page.
  2. From here, you must update the WordPress Address (URL) and Site Address (URL) fields :
  1. Once you have done this, click on the Save changes button.
  2. 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.

  1. After activation, you need to visit the Tools -> WP Search & Replace page.
  2. 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:
  1. Below, you will see all the tables in your WordPress database. You need to select all of them to perform a thorough check:
  1. Then click on the Preview Search & Replace button to see all the changes made by the plugin.
  2. Finally, click on the Replace All button:
  1. 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.

  1. First, you need to use your browser’s Inspect tool to find the resources and where they load.
  2. 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.
Updated on September 17, 2024

Related Articles