Privacy of the users needs to be respected and protected by any mean. In order to protect their privacies, that’s why some users love to comment anonymously on the website. Further, commenting on the website brings IP address of the users and making it vulnerable to abuse. To avoid that, stopping to store IP address in the WordPress comments is a good idea to protect user privacy. If you want to learn how to stop storing IP addresses of users, this blog will be useful for you to do that easily.
Pros and Cons of Not Storing IP Address in WordPress Comments
WordPress logs and stores IP addresses of users commenting on the website, by default. In fact, these IP addresses are stored in the database permanently.
The benefit of storing IP addresses is to combat undesirable comments or spam on the website. Site owners can block the IP addresses known to be exploited by the spammers using a plugin like Akismet.
Unless users use VPN service, it is easy to find IP addresses in the site log. Most of the WordPress hosting providers offer an access log of all visits to the website for a certain period only.
But, if you’re not storing IP addresses of a user in your WordPress site, there will be an improvement in the privacy in the website. Visitors will feel confident in expressing their opinion knowing that your site isn’t storing their IP addresses with the comments.
Stop Storing IP Addresses in Comments with Plugin
This method is recommended for the absolute beginner in the WordPress.
First, install and activate the remove IP plugin. Installing the plugin is similar to process required in other plugins.
Upon activation, the plugin will replace user IP with 127.0.0.1, it is the IP address used by the local host.
But, the plugin won’t delete the IP addresses stored with the older comments. If you want to delete the old comments that can be discussed later on as well.
Manually Stop Storing IP Addresses with WordPress Comments
If you have experience and comfortable with pasting code snippets in WordPress, you can this method instead.
Just add this code to your theme’s functions.php file or a site-specific plugin.
It is the same code used by the plugin which was mentioned in the first method. But, instead of storing 127.0.0.1, it is kept blank in the IP field.
How to remove IP Address From Old Comments?
If you want to remove the IP addresses from old comments, this method will be useful for you.
In this method, you will do this by running a MySQL query on the WordPress database. Before doing that, it is essential to have a most updated WordPress database backup.
Now, login into your WordPress hosting control panel and you will find phpMyAdmin.
Select your WordPress database by clicking on the database name in the column on the left hand. Then, you need to click on the SQL menu.
You will get a text area where you need to enter the below query:
Now, click on ‘Go’ button below the text area to remove all the IP addresses stored with the old comments in your WordPress database.
I hope the blog will be useful for you to stop storing the IP addresses of the users in WordPress comments.