Do you wish to cease storing IP addresses in your WordPress feedback?
By default, WordPress logs and shops the IP addresses of commenters to guard you in opposition to spammers. That mentioned, with the rise of knowledge privateness legal guidelines, chances are you’ll wish to cease this performance to guard your web site customer knowledge.
On this article, we are going to present you find out how to cease storing IP addresses in WordPress feedback.
![How to Stop Storing IP Address in WordPress Comments How to Stop Storing IP Address in WordPress Comments](https://www.wpbeginner.com/wp-content/uploads/2016/06/how-to-stop-storing-ip-address-in-wordpress-comments-og.png)
Ought to You Cease Storing IP Addresses in WordPress Feedback?
Except your commenters use a VPN, WordPress will retailer their IP addresses in your web site.
That is primarily used to fight spam feedback from suspicious IP addresses. Some safety plugins can also use IP addresses to place customers in a remark blacklist or block malicious IP addresses to forestall threats like brute drive assaults and DDoS assaults.
That mentioned, some customers could really feel uncomfortable understanding that their IP handle is logged after they depart a remark. They could assume that this info can be utilized in opposition to them, which might make them hesitant to interact along with your WordPress web site.
In case your web site caters to a worldwide viewers, then storing IP addresses with out consumer consent also can make your website much less compliant with the Basic Knowledge Safety Regulation (GDPR). It’s because the GDPR classifies IP addresses as private knowledge.
Most WordPress internet hosting suppliers maintain uncooked entry logs of all guests to your web site for a restricted time period. Plus, you may view these IP addresses when viewing the Feedback web page within the WordPress dashboard.
Now, let’s take a look at find out how to cease storing IP addresses and enhance your WordPress safety. Right here is an summary of what we are going to cowl:
The right way to Cease Storing IP Addresses in WordPress Feedback
This primary technique makes use of the WPCode plugin. We’ll use this plugin to insert a customized code snippet that stops your web site from storing IP addresses from the feedback part.
If that is your first time utilizing code, don’t fear. WPCode’s user-friendly interface makes it straightforward to insert and handle customized code, even for a newbie.
To make use of WPCode, it’s essential to set up the plugin first. For extra steering, take a look at our article on find out how to set up a WordPress plugin.
Observe: This text will use the WPCode free version, however be happy to improve to a Pro plan for extra superior options like conditional logic and scheduled snippets.
Now, it’s essential to go to Code Snippets » + Add Snippet out of your WordPress admin panel. After that, click on the ‘Use snippet’ button below ‘Add Your Customized Code Snippet’.
![Adding custom code in WPCode Adding custom CSS in WPCode](https://www.wpbeginner.com/wp-content/uploads/2023/11/wpcode-add-custom-snippet-css-1.png)
![Adding custom code in WPCode Adding custom CSS in WPCode](https://www.wpbeginner.com/wp-content/uploads/2023/11/wpcode-add-custom-snippet-css-1.png)
You’ll now see the Create Customized Snippet display screen.
First issues first, you must add a title on your code snippet. It may be one thing like ‘Disable IP Deal with in Feedback.’
Within the Code Kind dropdown, select ‘PHP Snippet.’ Then, within the Code Preview field, you may insert the next code:
perform wpb_remove_commentsip( $comment_author_ip ) { return ''; } add_filter( 'pre_comment_user_ip', 'wpb_remove_commentsip' );
After that, ensure that the toggle within the high proper nook says ‘Energetic’ and click on ‘Save Snippet.’
It ought to seem like this.
![Removing IP addresses in the comments using WPCode Removing IP addresses in the comments using WPCode](https://www.wpbeginner.com/wp-content/uploads/2023/11/wpcode-snippet-remove-ip-comments-min-min.png)
![Removing IP addresses in the comments using WPCode Removing IP addresses in the comments using WPCode](https://www.wpbeginner.com/wp-content/uploads/2023/11/wpcode-snippet-remove-ip-comments-min-min.png)
Now, the following time somebody leaves a remark, you gained’t see their IP handle on the WordPress Feedback web page.
Nevertheless, you’ll discover that earlier feedback nonetheless have this info saved. We’ll speak extra about find out how to take away this knowledge within the subsequent a part of the tutorial.
![What the comment looks like after removing the IP address using WPCode What the comment looks like after removing the IP address using WPCode](https://www.wpbeginner.com/wp-content/uploads/2023/11/example-comment-without-ip-min.png)
![What the comment looks like after removing the IP address using WPCode What the comment looks like after removing the IP address using WPCode](https://www.wpbeginner.com/wp-content/uploads/2023/11/example-comment-without-ip-min.png)
To take away IP addresses out of your older WordPress feedback, you have to to make use of phpMyAdmin. It’s a database administration platform that normally comes along with your WordPress internet hosting management panel.
Observe: Earlier than you do something, we strongly suggest you again up your WordPress database first. That approach, you may restore the database for those who make a important error.
When you do this, it’s essential to log in to your WordPress internet hosting account and search for the phpMyAdmin menu.
For Bluehost customers, you will see phpMyAdmin by going to ‘Web sites’ and deciding on the web site you wish to configure in your dashboard. It needs to be below ‘Fast Hyperlinks’.
![Navigating to the phpMyAdmin in Bluehost Navigating to the phpMyAdmin in Bluehost](https://www.wpbeginner.com/wp-content/uploads/2023/11/bluehost-phpmyadmin-min.png)
![Navigating to the phpMyAdmin in Bluehost Navigating to the phpMyAdmin in Bluehost](https://www.wpbeginner.com/wp-content/uploads/2023/11/bluehost-phpmyadmin-min.png)
Inside phpMyAdmin, you may navigate to the ‘SQL’ tab.
After that, enter this question under:
UPDATE wp_comments SET comment_author_IP = '';
Observe that if in case you have a customized WordPress database prefix, then please change wp_comments
to your customized desk prefix.
As soon as that’s achieved, merely click on the ‘Go’ button under the textual content space to run your question.
![Removing IP addresses in older WordPress comments using phpMyAdmin Removing IP addresses in older WordPress comments using phpMyAdmin](https://www.wpbeginner.com/wp-content/uploads/2023/11/phpmyadmin-remove-ip-address-min.jpg)
![Removing IP addresses in older WordPress comments using phpMyAdmin Removing IP addresses in older WordPress comments using phpMyAdmin](https://www.wpbeginner.com/wp-content/uploads/2023/11/phpmyadmin-remove-ip-address-min.jpg)
At this stage, simply return to your WordPress Feedback web page to see if the question labored correctly. That’s it!
We hope this text has helped you learn to cease storing IP addresses in WordPress feedback. You may additionally wish to see our knowledgeable picks for the very best WordPress safety plugins and our information to the tell-tale indicators hackers have hijacked your WordPress website.
Should you appreciated this text, then please subscribe to our YouTube Channel for WordPress video tutorials. It’s also possible to discover us on Twitter and Facebook.
Leave a comment