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.
[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
10 Comments
#http
#https #wordpress #securesite #ssl
thank you for your youtube video and help on this site!
Your welcome 🙂
thank you but still error showing on my website. Can you please help what more needs to be done.
https://w3services.net
You have insecure content on the page. That is the issue NOT your SSL. Check with https://whynopadlock.com or you can book a job here and I will fix it for you. https://a1websitepro.com/product/fix-it-for-me-appointment/
Thank you for the great video.
I did everything step by step as it is shown in the video, but it takes my site to the un-secure notification. On home page its fine but when I open any post it pops up warning un-secure site. How to resolve it. Thank You!
Site URL: https://www.techefeed.com
Make sure that you have a valid certificate installed before doing the steps in the video. As you can see in this image you have a self signed certificate which will create that warning. You need to get a valid certificate signed by a 3rd party.
Helpful Post …
Thanks a lot
Sure thing. Glad to help.