WordPress/HelpHub

New Page: How to move WordPress site from HTTP to HTTPS

atachibana opened this issue · 2 comments

There are two methods:

  1. Using the plugin
  2. Setting up WordPress manually (without plugin)

For above method 2, the step will be (but might be missing)

  1. Backup WordPress files and database
  2. Set SSL certificate
  3. Change WordPress URL from Administration Screen
  4. Replace the string 'http' to 'https' in the database contents
  5. Add redirect code into .htaccess

I just switched an old site to refresh up my memory for the exact steps:

Actual Instructions

  • Take a backup of files and database in case you need to revert for whatever reasons.
  • Get your webhost to install a TLS (also referred to as SSL) certificate for your website
  • Once installed ensure that your website is accessible on https URL, by simply replacing http with https i.e. adding a s to it. Eg: If your website was http://www.domain.com, new URL would be https://www.domain.com
  • See if you have any errors in your browser console complaining about mixed content, as you browse different pages on your website. Usually when using good quality plugin and theme, there won't be an issue. But if you do, you will need to resolve these issues.
  • Once you are satisfied with the results and are ready to flip the switch, go ahead and update the website URL in WordPress admin: Settings > General.
  • Now if you try to access http version of your website you will be redirected to https version. Best to try in an incognito/private window in your browser to test this.

Potential issues:

http to https redirect isn't working

I am not sure if changing the URL in WordPress causes it to issue redirects, though I believe it does. I never use it, as I always handle redirects on a server level.

Mixed-content warnings

Depending on what resources are causing these errors, it can either be your theme, any plugin you use or actual content you load in post/page and requires a different approach for each one of them.

Post/page content requires you to replace string, can be done via this plugin https://wordpress.org/plugins/better-search-replace/

Theme/plugins would require using the right functions to generate URLs or simply update the hardcoded urls to be https.

This issue was moved to the new repository.
WordPress/Documentation-Issue-Tracker#19