Skip to content

Early-bird lifetime licence: $199 once, for the first 200 buyers only. See the offer

Don’t store commenters’ IP addresses

New comments are saved without the commenter’s IP address and browser details, so you keep less personal data.

  • Type PHP
  • Runs Everywhere (runs as WordPress loads)
  • Tested with WordPress 7.1
PHP
<?php

add_filter( 'pre_comment_user_ip', '__return_empty_string' );
add_filter( 'pre_comment_user_agent', '__return_empty_string' );

Good to know

Spam filters such as Akismet check the IP address. Keep this off if you rely on them.

In these packs

  • Privacy and GDPR: Keep less personal data and send less of it to other companies.

Move your snippets over this afternoon.

Importing changes nothing until you switch over, and your old shortcodes keep working.