Knocklog

How to see AI bot traffic on WordPress

Jetpack Stats, Site Kit and Google Analytics count visits that run JavaScript. AI bots do not: they request the page, read the text and leave. To see them you have to look at the requests that reach the server.

Where bot visits are recorded

Every request goes through your host's server, which writes an access log with each visit's user agent. On cPanel hosts (Bluehost, HostGator, Hostinger, SiteGround and others) it is under Metrics > Raw Access. That is where names like GPTBot, ChatGPT-User, ClaudeBot and PerplexityBot show up.

Reading that file by hand works for a quick look, but it will not tell you whether a bot is genuine, or group the visits by agent and by page.

Option 1: from your host's log (no change to the site)

Works on any cPanel host and does not touch WordPress. A small script runs every 5 minutes from cPanel's Cron Jobs and sends the new log lines.

Some hosts only release the processed log, once a day. On those, visits arrive with that delay.

Option 2: with a PHP file (visits as they happen)

A PHP file loaded before WordPress records each request as it arrives, including the signatures some agents send.

<?php
require_once __DIR__ . '/knocklog.php';
// ...the rest of wp-config.php stays the same

Save the knocklog.php file Knocklog generates in the wp-config.php folder and add the line above right after <?php. If the site uses a page cache (LiteSpeed Cache, WP Rocket, WP Super Cache), cached pages never reach PHP: use Option 1 as well.

What you get to see

See how your WordPress site treats AI agents

The check is free and needs no sign-up.

Sources

Read next