
- MODX 3
- PHP 8.2


crawlerDetectBlock is in FormIt’s &preHooks.crawlerDetectBlock in preHooks.preHooks with crawlerDetectBlock.Test: submit the form with a bot User-Agent (e.g. Googlebot) via dev tools or curl.
[[!isCrawler]] uncached. With cache the result is the same for all visitors.vendor/autoload.php. The service is created, isCrawler() reports “not a bot”, nothing is written to the log.services->get. ERROR in the log, isCrawler returns 0. The crawlerDetectBlock preHook allows the submit in that case.[[+fi.validation_error_message]] (MODX) or {$modx->getPlaceholder('fi.validation_error_message')} (Fenom).Possible with an unusual User-Agent.
crawlerDetectBlock or check logs.Manage → System log. With crawlerdetect_log_blocked enabled, blocked form submissions are logged. The line is HTTP_USER_AGENT only, max 200 characters. HTTP_FROM and HTTP_SEC_CH_UA are not written.
No. Dependencies are included. Install CrawlerDetect via Package Manager.
Update the CrawlerDetect package via Package Manager. A new package version already ships an updated library. Do not update the library on the server separately. This package lockfile has jaybizzle/crawler-detect v1.3.11.
Yes. Add both preHooks to FormIt: CrawlerDetect and reCAPTCHA or another CAPTCHA.
&preHooks=`crawlerDetectBlock,recaptcha`'preHooks' => 'crawlerDetectBlock,recaptcha'CrawlerDetect is first in the list and filters bots before CAPTCHA.
AjaxForm is an alternative to FormIt. CrawlerDetect works through FormIt. If AjaxForm calls FormIt on the server, add crawlerDetectBlock to FormIt preHooks.
Yes. SendIt uses FormIt. Parameters are in presets. Add 'preHooks' => 'crawlerDetectBlock' to the preset. When a bot is blocked, SendIt returns an error and shows the message from CrawlerDetect settings. See Integration → AJAX form (SendIt).
No. MODX Revolution 3.x only.
No. The list comes from JayBizzle/Crawler-Detect. The package has no blacklist or whitelist of its own.