Adding SSL on WordPress site is not a big deal. But sometimes it’s not possible to add SSL easily on a live site. It’s because of content, links, media and media links are non-SSL. I visited lots of websites and blogs there are lots of ways to add SSL on a WordPress website. But server, WordPress, SSL are not all-time similar to those articles. I research and found the easiest way to add SSL on a WordPress website in any type of server. What we need to know before start using SSL on a WordPress website.
Table of Content:
- Install SSL on Web Server
- Install SSL on WordPress website
- Update all links using HTTPS URL
Install SSL on Web Server
There are so many companies who provide SSL certificate. It’s a premium service of the website. Though lot’s of the company offer a little price for SSL, I prefer to use Free first then I will decide to premium or not. In maximum case, Web Hosting Provider configure the SSL for their user or they give the customer a documentation for adding SSL on Web Server.
Install SSL on WordPress website
After configuration of SSL on Web Server, we will add a single line of code on “wp-config.php” file. Here are the code and screenshot of that code:
define( 'FORCE_SSL_ADMIN' , true);
Update All links using HTTPS URL
After adding code on “wp-config.php” we need to log in again and got dashboard / Admin Panel. Go to Appearance > Editor. After that open “functions.php” of your active theme. Here add two(2) lines of code at the top of the file but the inner section of PHP code. Here I will show code and images separately.
update_option(‘siteurl’, https://janealam.com); update_option(‘home’, https://janealam.com);
After that open the link of SSL and go to admin panel of your WordPress website. Your website’s all links, media, and media links will be converted to HTTPS.
Thanks for reading, if you succeed by following this article, share this article as thanks.