Google announced a while back that they would start giving search result priority to those sites that have an SSL Certificate (hosted under a secure connection). These steps will show you how to switch your WordPress site from HTTP to HTTPS
The process to change your WordPress site from HTTP to https is relatively simple. These steps are only for self-hosted WordPress sites.
Steps to Switch your WordPress Site from HTTP to HTTPS
- Purchase and Install an SSL Certificate for your domain. You can purchase this certificate through many different sources such as Namecheap or even your hosting provider (I suggest just buying one from your hosting provider and letting them handle it aka save yourself a headache).
- Verify that the SSL was installed correctly. You can verify by putting https://www.yourdomain.com into a website, make sure to change www.yourdomain.com to your own domain
- Create a Backup of your WordPress Files & Database! I do this anytime I make big changes. While this isn’t a huge change, it is still wise to do so!
- Change the URLs in WordPress. After you have verification that the SSL has been installed and is working you need to change the Wordpress address AND site address to reflect https instead of HTTP. If it is grayed out like the picture below, you will need to make this change within your wp-config.php file.
- Create a 301 redirect for all pages on your site. The simplest way to do this is to enable SSL in iThemes Security (if you have it installed). If you don’t then you can either do it through cPanel (assuming you have access) or through the .htaccess file on your server. If you are going the .htaccess route, you would put the following code AT THE VERY BEGINNING of your .htaccess file:
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L] - Verify the new site with Google Search Console. Since you are now using https you will need to verify the new domain with Google Search Console (formally Google Webmaster Tools). Just click the red Add Property button at the top right. Make sure when you input the URL that it starts with https.
- Update Google Analytics. If you are tracking your site stats with Google Analytics (and you should be) make sure to update the properties there as well! Do this by clicking on the Admin link on the left sidebar. Click property settings under property. Then choose the https dropdown under the default URL. Click save at the bottom to save your changes.
- Update ALL URLs on your website that point to HTTP URLs. After you have updated your URL in step 3 above, you may notice that hardcoded URLs in menu’s, posts, widgets, etc… did not change. No worries there is an easier fix than going through the hundreds (or like me) thousands of links. Install the Plugin Velvet Blues Update URLs (it is free). Once installed you will find it under tools on the left side in your WordPress admin panel. NOTE: This will only fix URL’s that are for your own domain name.
- Update URLs to images hosted on another domain. This one is a little more time-consuming. However, not all images will need to be updated.
- Check to see if you have mixed content. If you have mixed content (http and https properties) it could cause an invalid security notification to users. To fix this see the “No lock in the URL bar” below under known issues & their fixes.
- Always use https://www.yourdomain.com from here on out. This means whenever you comment on other blogs, or anywhere you may place your link.
Known Issues & Their Fixes
Images Will Not Show – If you have images that will not show after the move to https that is hosted on your own site, check to see if you have hotlink protection enabled (through your cPanel). If you do, make sure to add the https version of your domain to the whitelist.
No lock in the URL bar – When you switch to https, you should have a lock in your address bar which tells visitors your site is secure. If you don’t, then that means there is an issue which is most likely due to mixed content (a mixture of HTTP and https). The easiest way to find the issue is to use Google Chrome. In google chrome, navigate to your website. Click the 3 verticle dots at the top right and then choose More Tools > Developer Tools then click Console. You are looking for anything in yellow that says Mixed Content.
The Crumby Vegan says
So it turns out that my site is already https… Did I just get lucky? :)
lea kucherovsky says
I am always needing help with my blog! This is awesome advice!
Ashley says
I have been wondering lately how to do this, I’m glad I stumbled across your content, I pinned it!
Nicole Anderson says
Such an extremely interesting and useful post for anyone who has a http site. I learned a lot from this information, thank you.
Bridget Carlson says
You’re welcome!
Brown Sugar (@bsugarmama) says
My hosting company has been nagging me to do this for a while. I know I need to. I think your blog post was a sign.
nickanton says
Just what I needed to get my Google webmaster analytics back on track!