# Don't Store Commenters' Browser Details

> Stops WordPress from saving each commenter's browser user agent string with their comment, which is rarely needed and counts as personal data.

- Type: PHP
- Runs: Run everywhere
- Category: [Privacy & Cookies](https://wpide.com/library/category/privacy/)
- Tags: comments, user-agent, gdpr
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/privacy-no-comment-user-agent/

## Code

```php
add_filter( 'pre_comment_user_agent', '__return_empty_string', 20 );
```

## Notes

Akismet still receives the user agent at submission time for its spam check; it is just not stored.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Don't Store Commenters' Browser Details" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
