Можно, например, по
User Agent определять бота.
$user_agent = strtolower($_SERVER['HTTP_USER_AGENT']);
if(strpos($user_agent, 'bot') !== false) {
echo 'бот';
}
Судя по логам сервера - поиск по фразе "bot" дает, практически, точное попадание, если говорить о стандартных ситуациях.
46.229.168.148 - - [07/Oct/2019:06:25:11 +0300] "GET /shop/239349910-zerkalo-toyota-wish HTTP/1.1" 200 7292 "-" "Mozilla/5.0 (compatible; SemrushBot/6~bl; +http://www.semrush.com/bot.html)"
144.76.3.79 - - [07/Oct/2019:06:25:11 +0300] "GET /shop/621533900-blok-upravleniya-klimat-kontrolem-toyota-ist HTTP/1.1" 200 7143 "-" "Mozilla/5.0 (compatible; MJ12bot/v1.4.8; http://mj12bot.com/)"
144.76.3.79 - - [07/Oct/2019:06:25:13 +0300] "GET /shop/621533911-blok-upravleniya-klimat-kontrolem-nissan-avenir HTTP/1.1" 200 7192 "-" "Mozilla/5.0 (compatible; MJ12bot/v1.4.8; http://mj12bot.com/)"
46.229.168.143 - - [07/Oct/2019:06:25:13 +0300] "GET /shop/1633709-podnozhka-mitsubishi-delica HTTP/1.1" 200 7000 "-" "Mozilla/5.0 (compatible; SemrushBot/6~bl; +http://www.semrush.com/bot.html)"
144.76.3.79 - - [07/Oct/2019:06:25:14 +0300] "GET /shop/621533914-blok-upravleniya-klimat-kontrolem-nissan-terrano HTTP/1.1" 200 7195 "-" "Mozilla/5.0 (compatible; MJ12bot/v1.4.8; http://mj12bot.com/)"
178.154.200.66 - - [07/Oct/2019:06:25:15 +0300] "GET /shop/446937721-zerkalo-dlya-nissan-cedric HTTP/1.1" 404 3699 "-" "Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)"
178.154.200.66 - - [07/Oct/2019:06:26:19 +0300] "GET /turbo_feed/index HTTP/1.1" 200 7591 "-" "Mozilla/5.0 (compatible; YandexTurbo/1.0; +http://yandex.com/bots)"
54.36.148.50 - - [07/Oct/2019:06:26:21 +0300] "GET /userfiles/product_img/photos/8635/863561_0.jpg HTTP/1.1" 404 3699 "-" "Mozilla/5.0 (compatible; AhrefsBot/6.1; +http://ahrefs.com/robot/)"
178.154.200.66 - - [07/Oct/2019:06:26:25 +0300] "GET /shop/31984020-fara-honda-fit HTTP/1.1" 200 7091 "-" "Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)"
178.154.200.66 - - [07/Oct/2019:06:26:30 +0300] "GET /robots.txt HTTP/1.1" 200 83 "-" "Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)"
46.229.168.143 - - [07/Oct/2019:06:26:30 +0300] "GET /shop/290815930-stop-signal-nissan-skyline HTTP/1.1" 200 7110 "-" "Mozilla/5.0 (compatible; SemrushBot/6~bl; +http://www.semrush.com/bot.html)"
178.154.200.66 - - [07/Oct/2019:06:26:33 +0300] "GET /turbo_feed/index HTTP/1.1" 200 7594 "-" "Mozilla/5.0 (compatible; YandexTurbo/1.0; +http://yandex.com/bots)"
66.249.64.42 - - [07/Oct/2019:06:26:33 +0300] "GET /video/ HTTP/1.1" 200 5979 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
31.173.241.45 - - [07/Oct/2019:06:26:39 +0300] "GET /shop/?brand=Toyota&category=Nose%20Cut&page=17 HTTP/2.0" 200 30338 "https://abakan.domain.com/shop/?brand=Toyota&category=Nose%20Cut&page=16" "Mozilla/5.0 (Linux; Android 5.1; LYO-L21 Build/HUAWEILYO-L21; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.101 Mobile Safari/537.36 YandexSearch/8.60 YandexSearchBrowser/8.60"