How to Move WordPress from HTTP to HTTPS for Free

After reading this post you will learn the free the easiest ways to move your WordPress site from HTTP to https in less than 5 minutes without spending a penny, this will not be a weak or positive SSL which some panel offers for free. It is the best you can get and among the most secure on the web.

Google made it clear in 2014 that site with HTTPS will have better search privilege over the site with just HTTP read it here

Most webmasters, especially bloggers, took Google statement for a joke, but today we can experience a significant difference between HTTP and HTTPS in terms of Google’s search result.

For most bloggers, most especially new bloggers, one of the best way to improve their SEO is to migrate their blog from HTTP to HTTPS, and this has proven to be very positive. It is very easy to migrate.

HTTPS does not just give your website a better search reputation, it also keeps your site content and users info more secure, as it makes it very difficult for hackers to gain access to.

If you have an eCommerce or any other kind of site where users make purchases by using their credit card details, you must run such site on HTTPS; this will prevent third-party hackers as well as scammers to gain access your customers’ information.

Congratulations if you are running your eCommerce with WordPress, this step will also work perfectly for you – keeping your online store secured as well as boosting you customers confidence while shopping on your site.

Without saying so much about to importance of HTTPS, let’s learn how to move our WordPress blog from HTTP to HTTPS for free.

How to Migrate WordPress from HTTP to HTTPS for Free

Before doing this, you will need first to have the Cloudflare free flexible SSL. This means that you will first connect your WordPress site to Cloudflare.

Step 1

Secure Your Admin Dashboard

To secure your admin dashboard go to your  Control Panel click on File Manager


Next


Open your website location by clicking on public_html search for wp-config.php file and add the code below to your public_html script

define('FORCE_SSL_ADMIN', true);

Step 2

Use relative URL’s

The relative URL’s around your contents will be a great way to avoid issues when moving your WordPress site from HTTP to https. Open your phpMyAdmin from your control panel


Next, click on your WordPress database inside the phpMyAdmin. On the top Tab, click on SQL. Take perfect note of the database prefix; it may be something like wp_.

Enter the SQL code below to make all your site images relative URL’s.

Note: if your WordPress table prefix is not wp_  you will have to edit the code by changing wp_post to your-table-prefix_post this you will have to do in all script with table prefix during the process.

UPDATE wp_posts
SET    post_content = ( Replace (post_content, 'src="//', '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;

You will also need to run this next code below just in case if there are any URL’s with single quotations for src files.

UPDATE wp_posts
SET   post_content = ( Replace (post_content, "src='//", "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;

Then finally enter this last code below to change iFrames to secure.

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

Step 3

Set to https in General Settings

Log into your WordPress Admin dashboard and click on Settings in the menu on the right menu, select General and there change your site URL to your website in the two places to https://yourwebsite.com

Step 4

Change .htaccess file

On this final step, enter the code below at the top of your .htaccess file. This code if entered correctly will force your entire website to use https://

Note: the .htaccess file can be found in your cPanel file manager, if not visible then you will have to enable view dot file depending on your cPanel to make it visible.

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

And that is it all; you have successfully moved your WordPress site from http://to https://

Conclusion

Everything explained here is working perfectly as at the time this post was published. Please note that we are not giving any guarantee, this is why you must back up your site before trying to implement it.

Notwithstanding, it is still best that you purchase a valid SSL. Some hosting companies Namecheap gives free positive SSL, Bluehost gives free HTTPS features for WordPress. So do your research wisely.

RELATED ARTICLES

Leave A Reply

Your email address will not be published.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More

error: Content is protected !!