Adding SSL and HTTPS in WordPress

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

You need to create a CSR (Certificate Signing Request) and purchase a certificate. Once your SSL Certificate has been signed and issued, you will able to download SSL Certificate. After that you need to install certificates on the hosting server.

Once you have your certificate installed, you can follow the below steps for using SSL in WordPress.

WordPress Configuration:

Now it’s time to configure the WordPress for using SSL Certificate and HTTPS redirect at your site. You need only three modifications for completing WordPress SSL configuration.

.htaccess File:

Open the .htaccess file and remove all the existing code and placed the below code. Don’t forget to change with your domain name.

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$$1 [R,L]
# END WordPress

wp-config.php File:

Open the wp-config.php file and insert the following code into this file.

if (

Settings at WP Admin:

Go the the WP Admin General Settings page (Settings => General) and modify the WordPress Address (URL) and Site Address (URL) values from http:// to https://www.


Note that: Don’t forget to change all the hard coded links in https://www..

Are you want to get implementation help, or modify or extend the functionality of this script? Submit paid service request

Recommended Tutorials For You


  1. Arkaprava Majumder Said...
    • CodexWorld Said...

Leave a reply