Stop WordPress From Storing The IP Address For Comments

by admin
0 comment

Due to the GDPR and data protection regulations in the EU, it is not permitted to store the user's personal data without the user's active opt-in consent. This also includes the IP address. If you want to avoid the IP address notice, you can avoid saving the IP address at all.

The easiest way to do this is to add a small bit of PHP code into the WP theme's functions.php.

The following code ensures that WP no longer stores the IP address for comments:

function wp_no_comments_ip( $comment_author_ip ) { return ''; } add_filter( 'pre_comment_user_ip', 'wp_no_comments_ip' );

You may also like

Write a comment


* By using this form you agree to the storage and processing of your data by this website.