Skip to main content

benecaster_outlinks_bot_ua_list

Filter Premium outlinks

Filters the user-agent patterns Outlinks uses to tell bots from people when a tracked /go/ link is clicked. A click whose user agent contains any pattern, ignoring case, is recorded as a bot and shown as a filtered click rather than a person. The visitor is still redirected as normal. The user agent itself is never stored.

The bundled list covers search crawlers, chat and social link previews, monitoring services, command-line tools and HTTP libraries. Add your own uptime monitor or in-house crawler so its visits stop counting as people.

It runs on every click of a link whose show has Outlinks switched on. A show where Outlinks is switched off, or a site whose licence has lapsed, records no clicks, so the filter does not run there.

Parameters

Name Type Default Description
$ua_patterns array — The bundled patterns, lower-case substrings

Returns: array

Example

add_filter( 'benecaster_outlinks_bot_ua_list', function ( array $ua_patterns ): array {
    $ua_patterns[] = 'acme-uptime'; // Append: the array you return replaces the list.
    return $ua_patterns;
} );

Notes

The array you return replaces the bundled list, so return [ 'acme-uptime' ] alone and Googlebot counts as a person again. Patterns are plain substrings, not regular expressions: 'bot' already matches Googlebot and AhrefsBot. Entries that are not non-empty strings are dropped, and a return that is not an array keeps the bundled list. A click with no user agent is always a bot, whatever the list says. Walkthrough: Count your own monitor or in-house crawler as a bot in Outlinks click counts.

Need this built rather than just documented? See our services →