After you have enabled SSL certificate on your domain name, you will need to set up WordPress to use SSL and HTTPs protocols on your website.
We will show you two methods to do that, and you can choose one that best fits your need.
Method 1: Setup SSL/HTTPS in WordPress Using a Plugin
This method is easier and is recommended for beginners.
- Log into the WordPress Dashboard.
- Roll your mouse over Settings in the navigation menu, then click General.
- In the WordPress Address (URL) field, enter your https address.
- Enter your https address in the Site Address (URL) field.
- Click the Save Changes button on the bottom of the screen.
Once the settings are saved, WordPress will log you out, and you will be asked to re-login.
Then, you need to install and activate the Really Simple SSL plugin. For more details, see our step by step guide on how to install a WordPress plugin.
Upon activation, you need to visit Settings in the navigation menu, then click SSL. The plugin will automatically detect your SSL certificate, and it will set up your WordPress site to use HTTPs
The plugin will take care of everything including the mixed content errors. Here’s what the plugin does behind the scenes:
– Check SSL certificate
– Set WordPress to use https in URLs
– Set up redirects from HTTP to HTTPs
– Look for URLs in your content still loading from insecure HTTP sources and attempt to fix them.
Note: The plugin attempts to fix mixed content errors by using output buffering technique. It can have a negative performance impact because it’s replacing content on the site as the page is being loaded. This impact is only seen on first-page load, and it should be minimal if you are using a caching plugin.
Method 2: Setup SSL/HTTPS in WordPress Manually
This method requires you to troubleshoot issues manually and edit WordPress files. However this is a permanent and more performance optimized solution.
- Log into the WordPress Dashboard.
- Roll your mouse over Settings in the navigation menu, then click General.
- In the WordPress Address (URL) field, enter your https address.
- Enter your https address in the Site Address (URL) field.
- Click the Save Changes button on the bottom of the screen.
Once the settings are saved, WordPress will log you out, and you will be asked to re-login.
Next, you need to set up WordPress redirects from HTTP to HTTPS by adding the following code to your .htaccess file.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>
If you want to force SSL and HTTPS on your WordPress admin area or login pages, then you need to configure SSL in the wp-config.php file.
Simply add the following code above the “That’s all, stop editing!” line in your wp-config.php file:
define(‘FORCE_SSL_ADMIN’, true);
This line allows WordPress to force SSL / HTTPs in WordPress admin area
Once you do this, your website is now fully setup to use SSL / HTTPS, but you will still encounter mixed content errors.
These errors are caused by sources (images, scripts, or stylesheets) that are still loading using the insecure HTTP protocol in the URLs. If that is the case, then you will not be able to see a secure padlock icon in your website’s address bar.
Majority of the incorrect URLs will be images, files, embeds, and other data stored in your WordPress database.
All what you need to do is find all mentions of your old website URL in the database that started with http and replace it with your new website URL that starts with https.
You can easily do this by installing and activating the Better Search Replace plugin.