Anonymize IP address of WordPress comments
What can I do to stop storing the IP address?
Fortunately, this issue can be easily solved. By using the WordPress filter
pre_comment_user_ip we can overwrite the IP address and preventing future storage. Just add the following code snippet, for example, to your theme’s functions.php file:
The value “0.0.0.0” is just a placeholder. Normally you would see the correct IP address of the commentator here. The value could simply be empty, such as
return ''; In this case, you will see the zeroed or no IP address below the comments inside the WordPress backend.