How to move a WordPress site from HTTP to HTTPS (SSL)

To move a WordPress site from HTTP to HTTPS (SSL), use the following steps:

  1. Make a backup of your WordPress site using the Softaculous App Installer in cPanel, and wait for the backup to complete.

  2. Sign in to the WordPress admin dashboard, then visit General Settings and change the WordPress Address and Site Address to both begin with https:// (note the presence of the ‘s’ after ‘http’).

    Typically, it is best to include the www. for normal domains, for example https://www.example.com, and omit the www. for subdomains, for example https://sub.example.com.

  3. Select Plugins > Add New in the left column.

  4. In the search box on the top right, enter Really Simple SSL.

  5. In the box showing the plugin Really Simple SSL, select Install Now, wait for the installation to complete, then select Activate.

  6. Select the Activate SSL button.

  7. If you have the LiteSpeed Cache plugin installed, select LiteSpeed Cache > Toolbox in the left column, then select Purge All.

    If you have a different caching plugin installed, use the Purge All function provided by that plugin.

  8. Visit your website with its URL beginning with https:// to see if the website loads fine and correctly shows a locked padlock in the browser address bar.

    If everything looks okay, you’re all done and there is no need to proceed further!

  9. Visit phpMyAdmin in your hosting account’s cPanel.

    Your cPanel access details are listed on the hosting account’s Info page in the Client Lounge.

  10. In the left column, select the name of your WordPress site’s database.

    You can find the name of your WordPress site’s database in the wp-config.php file of your website.

  11. Select the SQL tab at the top.

  12. Run the following SQL statements to update instances of http:// found within posts (replace all instances of example.com below with your actual domain):

    UPDATE wp_commentmeta SET meta_value = REPLACE(meta_value, "http://example.com", "https://www.example.com");
    
    UPDATE wp_commentmeta SET meta_value = REPLACE(meta_value, "http://www.example.com", "https://www.example.com");
    
    UPDATE wp_comments SET comment_author_url = REPLACE(comment_author_url, "http://example.com", "https://www.example.com");
    
    UPDATE wp_comments SET comment_author_url = REPLACE(comment_author_url, "http://www.example.com", "https://www.example.com");
    
    UPDATE wp_comments SET comment_content = REPLACE(comment_content, "http://example.com", "https://www.example.com");
    
    UPDATE wp_comments SET comment_content = REPLACE(comment_content, "http://www.example.com", "https://www.example.com");
    
    UPDATE wp_links SET link_description = REPLACE(link_description, "http://example.com", "https://www.example.com");
    
    UPDATE wp_links SET link_description = REPLACE(link_description, "http://www.example.com", "https://www.example.com");
    
    UPDATE wp_links SET link_url = REPLACE(link_url, "http://example.com", "https://www.example.com");
    
    UPDATE wp_links SET link_url = REPLACE(link_url, "http://www.example.com", "https://www.example.com");
    
    UPDATE wp_options SET option_value = REPLACE(option_value, "http://example.com", "https://www.example.com");
    
    UPDATE wp_options SET option_value = REPLACE(option_value, "http://www.example.com", "https://www.example.com");
    
    UPDATE wp_postmeta SET meta_value = REPLACE(meta_value, "http://example.com", "https://www.example.com");
    
    UPDATE wp_postmeta SET meta_value = REPLACE(meta_value, "http://www.example.com", "https://www.example.com");
    
    UPDATE wp_posts SET guid = REPLACE(guid, "http://example.com", "https://www.example.com");
    
    UPDATE wp_posts SET guid = REPLACE(guid, "http://www.example.com", "https://www.example.com");
    
    UPDATE wp_posts SET pinged = REPLACE(pinged, "http://example.com", "https://www.example.com");
    
    UPDATE wp_posts SET pinged = REPLACE(pinged, "http://www.example.com", "https://www.example.com");
    
    UPDATE wp_posts SET post_content = REPLACE(post_content, "http://example.com", "https://www.example.com");
    
    UPDATE wp_posts SET post_content = REPLACE(post_content, "http://www.example.com", "https://www.example.com");
    
    UPDATE wp_posts SET post_title = REPLACE(post_title, "http://example.com", "https://www.example.com");
    
    UPDATE wp_posts SET post_title = REPLACE(post_title, "http://www.example.com", "https://www.example.com");
    
    UPDATE wp_posts SET post_excerpt = REPLACE(post_excerpt, "http://example.com", "https://www.example.com");
    
    UPDATE wp_posts SET post_excerpt = REPLACE(post_excerpt, "http://www.example.com", "https://www.example.com");
    
    UPDATE wp_term_taxonomy SET description = REPLACE(description, "http://example.com", "https://www.example.com");
    
    UPDATE wp_term_taxonomy SET description = REPLACE(description, "http://www.example.com", "https://www.example.com");
    
    UPDATE wp_usermeta SET meta_value = REPLACE(meta_value, "http://example.com", "https://www.example.com");
    
    UPDATE wp_usermeta SET meta_value = REPLACE(meta_value, "http://www.example.com", "https://www.example.com");
    
    UPDATE wp_users SET user_url = REPLACE(user_url, "http://example.com", "https://www.example.com");
    
    UPDATE wp_users SET user_url = REPLACE(user_url, "http://www.example.com", "https://www.example.com");
    
  13. Visit the various pages of your WordPress site via HTTPS to see if they’re loading correctly. If there are still HTTPS errors such as mixed-content errors, there may be embedded elements in your WordPress theme whose URLs have been hard-coded to begin with http://.

    To see if this is the case, check the .php files in the wp-content/themes/[your theme] folder for embedded elements (such as images, CSS, and JavaScript files) that have URLs that are hard-coded to begin with http://, and modify them to begin with https:// instead.

Your WordPress site should now be accessible via HTTPS, and a secure padlock logo should appear in your web browser when you visit your website.

Should you have any questions about making your WordPress site accessible via HTTPS, please feel free to open a Client Care ticket via the Client Lounge.