The Must Have for WordPress
The Must Have for WordPress
×
  • Home
December 5, 2019
WordPress

Anonymize IP address of WordPress comments

by Martin Jost
No comments
1 min Reading Time
210 Views
5 Score
2 Likes
Share on Facebook Tweet on Twitter Share on Linkedin Pin on Pinterest Send via E-Mail Send via WhatsApp

In the context of the European privacy policy regulations some regulations for web page owners are to be considered. This includes, among other things, the anonymization of the IP address of commentators. Because according to privacy policy regulations, the IP address is a personal data.

What can I do to stop storing the IP address?

By default, the IP address is stored for each comment in the WordPress database. This is not permitted according to the European privacy policy regulations!

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.

Last updated: December 5, 2019

Anonymize IP address of WordPress comments Score: 5 / 5 (2votes)
Share on Facebook Tweet on Twitter Share on Linkedin Pin on Pinterest Send via E-Mail Send via WhatsApp
The Author
Published by
Martin Jost

View all posts by Martin Jost

Related Posts
C
Gutenberg Calculate the correct content width for the Gutenberg editor

The WordPress Gutenberg editor allows you to customize and edit web page content according to th ...

Read More
C
Database Create a connection to WordPress MySQL database in PHP

WordPress stores all the website data in a database and uses it, for example, if a certain conte ...

Read More
U
PHP Use PHP to remove certain characters or words from a string

The default PHP function str_replace(); is a useful tool if we want to remove certain characters ...

Read More
Read more
R
Previous Post
Remove the URL field in the WordPress comments form
R
Next Post
Remove date / time from WordPress comments
Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

  • Imprint
  • Privacy Policy
© 2016-2021 - wphave - The Must Have for WordPress
Login

Lost your password?

RequiredEssential cookies enable basic functions and are necessary for the proper functioning of the website.
  • Name: Cookie Status
  • Provider: Owner of this website
  • Purpose: Is necessary to check whether the user's web browser allows cookies.
  • Privacy Policy: https://wphave.com/privacy-policy/
  • Cookie Name(s): cookie_status
  • Duration: 1 Minute
  • Name: Cookie Consent
  • Provider: Owner of this website
  • Purpose: Is necessary to check whether the user agrees to allow opt-in cookies or not.
  • Privacy Policy: https://wphave.com/privacy-policy/
  • Cookie Name(s): cookieconsent_analytics, cookieconsent_marketing, cookieconsent_status
  • Duration: 1 Year
  • Name: Like Button
  • Provider: Owner of this website
  • Purpose: Is necessary to check whether the user has already gave a like for a specific post.
  • Privacy Policy: https://wphave.com/privacy-policy/
  • Cookie Name(s): like_btn_{POST_ID}
  • Duration: 21 Days
  • Name: Post Rating
  • Provider: Owner of this website
  • Purpose: Is necessary to check whether the user has already rate a specific post.
  • Privacy Policy: https://wphave.com/privacy-policy/
  • Cookie Name(s): rating_{POST_ID}
  • Duration: 7 Days
AnalyticsStatistics cookies collect information anonymously. This information helps us to understand how our visitors use our website.
  • Name: Google Analytics
  • Provider: Google LLC
  • Purpose: Google cookie for website analysis. Generates statistical data on how the visitor uses the website.
  • Privacy Policy: https://policies.google.com/privacy
  • Cookie Name(s): _ga, _gat, _gid
  • Duration: 2 Years