Switching your site to all-HTTP from HTTPS is like going against the winds.
Since Google announced that sites that switch to HTTPS would get a small bump in traffic, webmasters across the web have been switching their sites.
I, too, switched to all-HTTPS.
It was after a year when I discovered how badly it impacted my AdSense earnings that I switched back to HTTP. Since switching back to HTTP, my AdSense income has recovered a bit.
For those who feel the same.. here’s the steps I took to get my WordPress site back to HTTP from HTTPS.
It’s not overly complicated, but doing it wrong may damage your site and its database.
This brief tutorial is going to show you how to easily switch your WordPress site from HTTPS to HTTP.
To get started, the first thing to do is to backup your database and site content. You should never perform site changes that included changing database content without first backing up your database.
That’s webmaster tutorial 101.
Always backup your site before making changes that may destroy it. So, backup your WordPress database and its content.
When using WordPress, its main content for your site lives in the root directory of your server, mostly. Most likely in /var/www/html or /var/www/public_html
For those using cPanel or similar tools to manage their site online, they can use the backup tools available to backup their site’s content and databases.
If you’re running Linux machine with root access, copy the entire root directory of your site.
Then run the commands below to back up your site database.
sudo mysqldump -u root -p database_name > database_name.sql
Replace database_name with your WordPress database name.
At this point, you should have already backed-up your site content (images, media and other content) that live in the root directory and sub-directories as well as its databases.
Next, run the command below to sign onto your database server. In Linux systems, it going to be MySQL or MariaDB.
mysql -u root -p
When prompted for your root password, enter it. After successfully logging in, continue with the steps below.
Run the commands below to update WordPress database post_content table entry to reference the new domain.
UPDATE wp_posts SET post_content = REPLACE(post_content, 'https://www.oldsite.com', 'http://www.newsite.com');
Next, run the commands below to update WordPress database meta table entry to reference the new domain.
UPDATE wp_postmeta SET meta_value = REPLACE(meta_value, 'https://www.oldsite.com', 'http://www.newsite.com');
Finally, run the commands below to update the WordPress site permalinks.
UPDATE wp_options SET option_value = REPLACE(option_value, 'https://www.oldsite.com', 'http://www.newsite.com');
This can also be applied to sites moving from HTTP to HTTPS. Can be applied to site moving to a completely different domain as well.
After doing this, WordPress should begin to function on HTTP.
The WordPress potion is done, but you also need to implement 301 webserver redirects.
You need to perform a 301 redirect your webserver. To do it when using Nginx webserver, read this post.
In Apache2, you may be able to find tutorials online that may help.
For forget to change Nginx server block to point to port 80 as well. Also, perform the 301 redirect in the 443 server block.
Hope this was helpful.