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
1.1 K 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
R
WordPress Remove date / time from WordPress comments

By default, the date and time of a comment are displayed in WordPress. Basically, it is always a ...

Read More
G
PHP Get the absolute File Path (Document Root-Path) in WordPress

Wenn man als Webentwickler mit Dateien arbeitet, die auf dem Server liegen und diese innerhalb e ...

Read More
C
WordPress Customize or Modify the WordPress Post Excerpt

WordPress comes with own functions, such as get_the_excerpt() or the_excerpt(), to output a shor ...

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-2023 - 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