+1-855-211-0932 (ID:287497)
Don't have an account yet? Sign up now!

HomeArticlesHow To Enable SSL (HTTPS) in WordPress?

How To Enable SSL (HTTPS) in WordPress?

How To Enable SSL (HTTPS) in WordPress

Category: WordPress

After you have enabled the 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.

  1. Log into the WordPress Dashboard.
  2. Roll your mouse over Settings in the navigation menu, then click General.
  3. In the WordPress Address (URL) field, enter your HTTPS address.
  4. Enter your HTTPS address in the Site Address (URL) field.
  5. Click the Save Changes button at 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 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.

  1. Log into the WordPress Dashboard.
  2. Roll your mouse over Settings in the navigation menu, then click General.
  3. In the WordPress Address (URL) field, enter your HTTPS address.
  4. Enter your HTTPS address in the Site Address (URL) field.
  5. Click the Save Changes button at 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 the WordPress admin area.

Once you do this, your website is now fully set up 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.

The majority of the incorrect URLs will be images, files, embeds, and other data stored in your WordPress database.

All 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.

© 2024 How To Enable SSL in WordPress


Tags: , , , , , , , , , ,

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>