Adding SSL and HTTPS in WordPress

Present days, SSL is important for every type of websites. It helps to make your website secure and earn the trust of your website’s visitors. Besides this, SSL certificate and HTTPS boosts your website ranking on various search engines. So, if you don’t have already added SSL to your website, it’s time to move from HTTP to HTTPS.

Are you want to move from HTTP to HTTPS and install an SSL certificate in WordPress site? This step-by-step guide will make it easier to add SSL to website. In this tutorial, we will show you how to add SSL and HTTPS in WordPress.

What are SSL and HTTPS?

SSL (Secure Sockets Layer) creates an encrypted layer when data passed between two systems. Whether it is server to server or server to browser communication, SSL encrypts the data to make it secure. SSL and HTTPS both are used to protect the online data by creating a secure connection between browser and server.

  • SSL – Transport Layer Security protocol that provides communications security over a network.
  • HTTPS – HTTP over Transport Layer Security protocol that provides secure communication over a network.

SSL Certificate is a text file that contains encrypted data. SSL Certificate helps to make secure sensitive communications between your site and your customers.

Add SSL and HTTPS in WordPress

It’s very easy to add SSL and implement HTTPS redirection in WordPress. Follow the below step-by-step guide to install SSL and configure WordPress to enable SSL and HTTPS to your website.

Choose and Buy Suitable SSL Certificate

There are three commonly used SSL certificate types are available.

  • Domain Validation (DV): This certificate verifies the owner of the domain.
  • Organization Validation (OV): This certificate verifies the owner of the domain and organization.
  • Extended Validation (EV): This certificate provides the highest level of security with strict verification of the organization.

The cost of SSL certificate varies from one hosting provider to another. Generally, SSL certificate cost $50 – $250 USD per year. To add SSL to the website, choose a right SSL certificate as per your needs and buy it from a trusted SSL provider.

You can buy an SSL certificate for only $9/year at Namecheap.

Install SSL Certificate

Once you have done CSR (Certificate Signing Request) and purchased an SSL Certificate, your SSL Certificate will be signed and issued. Now you need to download SSL Certificate and install it on the hosting server. Otherwise, you can ask your web hosting provider to install it on your server.

Setup WordPress to Use SSL and HTTPS

Once you have SSL certificate installed on your server, now you need to configure the WordPress for using SSL Certificate. Configure the following settings to add SSL and HTTPS in WordPress.

  • Update WordPress URL to HTTPS:
    Login to your WordPress admin panel and navigate to Settings » General. Change the WordPress Address and Site Address, and add https://www. instead of http:// in the beginning.


    If you are implementing SSL in your existing site, you need to setup SSL redirect. Use HTACCESS file to setup SSL redirect from HTTP to HTTPS in WordPress.
    Add the following code in the root’s .htaccess file to redirect HTTP URL to HTTPS with www.

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{SERVER_PORT} 80 
    RewriteRule ^(.*)$$1 [R,L]

    Don’t forget to replace with your site domain name.

  • Force SSL for Admin and Content:
    Add the following code above the “That’s all, stop editing! Happy blogging.” line in the wp-config.php file.

    if (
    $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https'):
  • Change All Links to HTTPS:
    If you’re adding SSL to your existing WordPress site, make sure all the links are modified with HTTPS. Otherwise, many browsers (Google Chrome, Firefox, etc.) may show the Not Secure and Mixed Content warning. It can be done by replacing all links from http to https in the database.

After successfully implemented SSL and HTTPS, a green bar will show in the address bar of the browsers.


Related Articles

Comments 0