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.

Only cool people share!

[code]define(‘FORCE_SSL_ADMIN’, true);[/code]

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.

[code]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;[/code]

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

[code]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;[/code]

Enter this last code to change iFrames to secure.

[code]UPDATE wp_postmeta
SET meta_value=(REPLACE (meta_value, ‘iframe src="http://’,’iframe src="//’));[/code]

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://

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

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: October 26th, 2021 by Maximus Mccullough
move to https on wordpress

10 Comments

Leave a Reply

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