• Skip to primary navigation
  • Skip to main content
Sal Ferrarello
  • About Sal Ferrarello
  • Speaking
  • Connect
    Mastodon GitHub Twitter (inactive)
You are here: Home / HTTPS / How I Moved My Siteground WordPress Sites to HTTPS

How I Moved My Siteground WordPress Sites to HTTPS

Last updated on July 10, 2017 by Sal Ferrarello

Siteground‘s integration with Let’s Encrypt is amazing. Below I’ve documented how I’ve moved my sites to https on Siteground, they’ve done a terrific job making this easy.

Setup Your HTTPS Certificate with Let’s Encrypt

Log into your Siteground cPanel account and find Let’s Encrypt under Security.

Siteground Lets Encrypt in cPanel

Choose your domain and enter your email address

Siteground Lets Encrypt Install Certificate Screen

Click Install

Ta da, Siteground and Let’s Encrypt do the work for you and when they’re done you have a certificate in place and can access your site with https.

Modify Your WordPress Site to use HTTPS

At this point, you’ve probably noticed some issues when accessing your site via https.

  • your images are not loading
  • you have no green secure indicator in the URL bar
  • if you look in the console, you’ll see a lot of Mixed Content errors

Screenshot of Initial Problems When Moving to https

We need to update our WordPress site to use https in all the generated URLs and to update all the content (and the post meta) in the database to https. This sounds like a daunting chore. WP-CLI to the rescue. The really good news is WP-CLI is pre-installed on Siteground’s servers.

So we SSH into the server, navigate to the correct directory, and make a backup of our database.

ssh sal@m12.siteground.biz -p18765
cd www
wp db export

Then we update all instances of our site from http to https.

Dry run first to check everything looks good, without making any changes.

wp search-replace 'http://salferrarello.com' 'https://salferrarello.com' --skip-columns=guid --dry-run

Then we make the changes and flush our cache.

wp search-replace 'http://salferrarello.com' 'https://salferrarello.com' --skip-columns=guid
wp cache flush

At this point in the process, my images are loading and I’m getting the green lock at https://salferrarello.com/.

If you’re not getting the green lock, you’re still loading some assets with http instead of https. This happens if you’re loading assets from other servers, for example if you were loading the image http://imgs.xkcd.com/comics/git.png on your page. If this occurs, you’ll want to track down anywhere you’re using http:// and update it to https://.

Beaver Builder Cache

If the site has the Beaver Builder plugin, you’ll need to clear the Beaver Builder Cache. At the time of this writing, the clear cache button appears at /wp-admin/options-general.php?page=fl-builder-settings#tools

Add 301 Redirects from http to https

Now that your site is using https, we want to make certain visitors end up there.

Add this code to the beginning of your .htaccess file to redirect from http to https.

# BEGIN Always use https
# See https://salferrarello.com/how-siteground-wordpress-https/
<IfModule mod_rewrite.c>
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
</IfModule>
# END Always use https

Google Search Console/Webmaster Tools Update

If you’re not using Google Search Console to monitor Google’s indexing of your site, I recommend you start. If you’re already using it, you’ll want to add the https URLs for your site to your Search Console account. With this move you’ll have two entries in Google search console. For me they are:

  • http://salferrarello.com (the old HTTP version)
  • https://salferrarello.com (the new HTTPS version)

Note: I don’t have www.salferrarello.com listed because it redirects to salferrarello.com.

Limitations on Old Browsers

Not all browsers support Let’s Encrypt certificates. Checkout the list of Let’s Encrypt supported browsers, which includes all major browsers.

Next Steps

You can do more to improve your https setup. Zach Tollman’s blog has a ton of great information on this topic. You can also test and improve your https setup with https://securityheaders.io/.

If you’re not hosting with Siteground, you may want to check them out. They are a great hosting choice for a technical user.

Photo credit: Modified from Creativity103 on flickr
Sal Ferrarello
Sal Ferrarello (@salcode)
Sal is a PHP developer with a focus on the WordPress platform. He is a conference speaker with a background including Piano Player, Radio DJ, Magician/Juggler, Beach Photographer, and High School Math Teacher. Sal can be found professionally at WebDevStudios, where he works as a senior backend engineer.

Share this post:

Share on TwitterShare on FacebookShare on LinkedInShare on EmailShare on Reddit

Filed Under: HTTPS Tagged With: WordPress

Reader Interactions

Comments

  1. Sonja says

    February 7, 2017 at 1:28 pm

    Thank you very much!

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Copyright © 2023 · Bootstrap4 Genesis on Genesis Framework · WordPress · Log in