---
title: Customize User Agent Filtering
canonical: https://wpsecurityninja.com/docs/filters-hooks/filter-user_agent_items/
---
The `user_agent_items` filter changes which User-Agent substrings Filter Suspicious Queries blocks.

Matching is a substring search, so you can be broad or specific.

```php
add_filter( 'user_agent_items', 'filter_user_agent_items' );

function filter_user_agent_items( $useragents ) {
  // Copy the line below to add more agents.
  $useragents[] = 'seekportbot';
  return $useragents;
}
```

> Not sure how to add this code? See [How to include custom code on your website](https://wpsecurityninja.com/docs/installation-and-usage/custom-code-website/).
