1 Star2 Stars3 Stars4 Stars5 Stars (24 votes, average: 4.92 out of 5)

WordPress From HTTP to HTTPS Easy Instructions Fastest Way

If you are ready to move your WordPress from HTTP to HTTPS the fastest and easiest way follow these steps.

#wordpress

Step #1 Make Admin Secure *

Make your admin secure by opening up the wp-config.php file and putting in the following code.

define('FORCE_SSL_ADMIN', true);

Step #2 Use relative URL’s *

Using relative URL’s within your content is a great way to avoid headaches when going from http to https in WordPress. Log into your phpMyAdmin and click on your WordPress database. On the top Tab click on “SQL”. Take note of the database prefix, it could be something like wp_. If yours is different make sure you change it.

Enter this SQL code to make all your images relative URL’s.

UPDATE wp_posts 
SET    post_content = ( Replace (post_content, 'src="http://', 'src="//') )
WHERE  Instr(post_content, 'jpeg') > 0 
        OR Instr(post_content, 'jpg') > 0 
        OR Instr(post_content, 'gif') > 0 
        OR Instr(post_content, 'png') > 0;

Run this next code just in case there are any URL’s with single quotations for src files.

UPDATE wp_posts 
SET   post_content = ( Replace (post_content, "src='http://", "src='//") )
WHERE  Instr(post_content, 'jpeg') > 0 
        OR Instr(post_content, 'jpg') > 0 
        OR Instr(post_content, 'gif') > 0 
        OR Instr(post_content, 'png') > 0;

Enter this last code to change iFrames to secure.

UPDATE wp_postmeta 
SET meta_value=(REPLACE (meta_value, 'iframe src="http://','iframe src="//'));

Step #3 Set to https in General Settings *

Log into your WordPress dashboard and go down to the “Settings” menu. Click on “General” and there change your address to your website in the 2 places to https://yourwebsite.com

Step #4 Change .htaccess file *

Enter the following code at the top of your htaccess file. This will force your entire website to use https://

# Force HTTPS
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

More References *

For more referencess see Moving to HTTPS on wordpress by Chris Coyer

WordPress From HTTP to HTTPS Easy Instructions Fastest Way was last modified: August 31st, 2017 by Maximus Mccullough

move to https on wordpress

10 Comments

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.