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.

Enjoy!

 

 

Frequently Asked Questions

What are the steps to switch a WordPress site from HTTPS to HTTP?

To switch your WordPress site from HTTPS to HTTP, you need to first backup your database and site content. Then, copy the entire root directory of your site if you have root access. Finally, run commands to back up your site database.

Why would someone want to switch their WordPress site from HTTPS to HTTP?

Some may want to switch back to HTTP due to a negative impact on AdSense earnings after switching to HTTPS. It is essential to back up your site before making such changes.

What is the main content location for a WordPress site on a server?

The main content for a WordPress site usually resides in the root directory of the server, typically in /var/www/html or /var/www/public_html for most setups.

How can cPanel users back up their WordPress site's content and databases?

cPanel users can utilize the backup tools available in cPanel to back up their site's content and databases easily and efficiently.

What is the command to back up a WordPress site's database on a Linux machine with root access?

On a Linux machine with root access, the command to back up a site's database is 'sudo mysqldump -u root -p database_name > database_name.sql', replacing 'database_name' with your WordPress database name.

Why is it crucial to back up your site content before making changes that may affect it?

Backing up your site content is essential to prevent data loss or damage during any changes. It is a fundamental practice for webmasters to ensure site integrity.

What are the potential risks of not backing up your WordPress site before switching from HTTPS to HTTP?

Not backing up your site before such a switch can lead to loss of data, site functionality issues, or even complete website downtime. It's crucial to always have a backup.

How can switching a WordPress site from HTTPS to HTTP impact AdSense earnings?

Switching from HTTPS to HTTP may negatively impact AdSense earnings, as observed in some cases. It's important to monitor any changes in revenue and site performance after making such adjustments.