How To Install SSL Certificate in WordPress Site

Back in 2004, Google announced that it will give more preference to boost to a site in search engine which contains SSL Certificate installed on its site. Furthermore, Google Chrome will now mark every website without HTTPs as non-secure. You’ve probably noticed why your chrome browser is showing NOT SECURE if you try to access the site without Https. If collects subscriber’s private information like Passwords, Personal Data, and other billing information, now is the time for you to install SSL certificate and migrate to HTTPs. Before we begin to learn to Install SSL Certificate in WordPress, let’s grasp some knowledge regarding What Really is SSL and why we need it. Shall we?

What is SSL Certificate?

Install SSL Certificate in WordPress

SSL Certificate is a small encrypted data file which encrypts information sent from the browser to the server. Using SSL, hackers cannot steal user’s private information to misuse them. Furthermore, each SSL issues an unique certificate to each website to identify whether a site is secure or not. If the certificate matches with the site, it will display HTTPs instead of HTTP with fully displayed green padlock right before the domain name.

Why and When To Use SSL?

The SSL is to keeps information sent from the browser across the internet secure and encrypted so that the receiver can get the message they need. Because it is always important that the information you send through the internet is reached to the destination server without any hassle.

E-commerce websites mostly use Paypal, Credit Card, Stripe, etc. to make an online transaction. Therefore, you definitely need an SSL Certificate for an e-commerce site to make sure that customer’s private information do not get violated in any way. Moreover, you can use secure socket layer i.e. HTTPs if your site contains personal information of users like username & passwords for instance.


Install SSL Certificate in WordPress Site

Step 1: Buy SSL Certificate

Install SSL Certificate in WordPress

This is the basic step. Without purchasing SSL, you can’t have a secure connection installed on our site. You should also be aware fo the fact that the cost of SSL Certificate varies from one hosting providers to another. It also depends on which SSL you’d need for your website. For instance, if you are using an e-commerce website, it is recommended that you purchase the one which offers higher security. Conversely, for a personal blog or business websites, a normal certificate will work just fine. Again, it is your choice which one to use.

These days, many hosting providers give a free SSL certificate to a single domain due to high competition in the market. That’s why you can find a chunk of service providers which sells SSL. The most reliable SSL Certificate trusted by many customers are:

Step 2: Install SSL Certificate On Your Cpanel

Once you purchase SSL Certificate, the hosting providers will provide you Private Keys, Public keys, and Certificate to install on your Cpanel. As the name suggests, a Public key is public to every visitors and the Private key is Private in the sense that it encrypts the data so that others cannot have access to it.

For instance, if X wants to send an information to Y, X will encrypt the data with Y’s public key to ensure that only Y will get the message. This way none other than Y will see what the message really is.  And for the record, only Y will have access to X’s private key. The same cryptography technique is used in SSL Certificate.

Also Read:   How to Limit Login Attempts in WordPress Website

Login to your Cpanel and insert the respective keys provided by the SSL Owners.You will see something like below screenshots in your Cpanel.

Click on the SSL/TLS link from above and insert the keys manually. Simple as that.

Step 3: Insert Code

This is the final Step. Once you correctly install the certificates on your site, just adding few lines of code will work. There are two methods. 1. Adding code in your .htacess file. 2. Adding another code in your functions.php file. I would recommend adding to your theme’s functions.php file because it is safer and easier process. However, it’s your choice to make. Both will work but follow only one.

  • Adding Code on .htaccess file

    Copy the below lines of code in your .htaccess file which is located in the root directory of your website. If it’s not there, create one.

<lfModule mod_rewrite.c>
  RewriteEngine On
  RewriteCond%{SERVER_PORT} 80
  RewriteRule ^(.*)$ https://yourwebsite.com/$1 [R,L]
  • Adding Code to functions.php

    Open your current theme’s functions.php (most preferably in your Child Theme) file and copy and paste the following lines of code.

    function HttpToHttps(){
     if($_SERVER['HTTPS']!="on"){
       $redirect= "https://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
        header("Location:$redirect");   
    }}
    add_action('init','HttpToHttps' );

Final Thoughts

Though many internet pundits claim that using SSL or HTTPs slow your website. the speed is so negligible that no one will even notice it. Further, it is always wise to use SSL on your site whether it is a personal site or business site. The visitors trusts your site more than others even if they have similar contents to your site.

This is the simple but effective way to install SSL Certificate on your WodPress site. If you have any question/issue regarding the SSL Certificate, do not hesitate to comment in the form below. If this article helped you do not forget to share. Secure Yourself !!

 

The following two tabs change content below.

Prabin Parajuli

Tech-Blogger, Web Enthusiast
Prabin Parajuli is a Web Developer, Blogger, freelance writer, and a pet lover. He also loves to travel a lot.

Latest posts by Prabin Parajuli (see all)

Share This Post