Universal link availability checker for Statamic v6. Scans your content, checks HTTP status of links, and displays a paginated table in the control panel (Tools → Link Checker) with emphasis on errors (4XX/5XX).
Features
- Traverses all entries and extracts links from any field type (Bard, Markdown, Link fieldtype, plain text fields).
- Distinguishes external, internal/relative, and
statamic://entry::…/entry::…references (unresolved references are reported as broken). - Concurrent HTTP checking (Guzzle pool, HEAD → GET fallback), redirect tracking.
- Fragment anchor validation — verifies that
#anchortargets exist on the page. - Asset existence checking — detects broken
statamic://asset::references. - Run history and newly broken links detection (diff against previous run).
- Ignore-list via the CP to suppress false positives.
- Dashboard widget showing broken link count.
- Auto-scan on publish and scheduled runs with email notifications.
- Background execution via queue.
- Results are cached — the table simply pages through the stored report.
- Fully configurable via
config/statamic-link-checker.php.
Installation
composer require martinoak/statamic-link-checkerphp artisan vendor:publish --tag=statamic-link-checker-config
Usage
- CP: Tools → Link Checker → Run check button. Filter by Problems only / All and toggle categories Internal / External / Unresolved.
- CLI:
php artisan link-checker:scan(optionally--collection=pages --collection=news,--site=en --site=cs,--queueto queue the job,--notifyto email a report when done).
Automation
- Scheduled run + notifications: Set
schedule.enabled = truein config (frequency: hourly|daily|weeklyor customcron) andnotifications.enabled = truewith recipients innotifications.mail. The addon registerslink-checker:scan --notifyautomatically; just ensure Laravel scheduler is running (* * * * * php artisan schedule:run). Notifications requireMAIL_FROM_ADDRESS/MAIL_FROM_NAMEto be set.notifications.on = newsends only newly broken links;allsends every broken link. - Auto-scan on publish: With
auto_scan = true, whenever a published entry is saved, its links are checked and merged into the report (viaEntrySavedlistener).
Background execution (queue)
Both full scan and auto-scan run through queue jobs. With the default QUEUE_CONNECTION=sync,
they execute inline. For true background processing:
php artisan queue:table && php artisan migrate # database driver only# .env: QUEUE_CONNECTION=database (or redis)php artisan queue:work
Ignore-list
Each link in the table has an Ignore button; ignored links are hidden from the main
list and excluded from notifications. The Ignored filter shows them and allows
removal. Data is stored in storage/statamic-link-checker/ignored.json (path: ignore_file).
Dashboard widget
Add the widget handle to config/statamic/cp.php → widgets:
['type' => 'broken_links', 'width' => 50],
Multisite
The addon is site-aware. It scans entries across all sites; relative and statamic://
links are resolved in the context of their origin site (per absolute URL).
Limit the scope via config sites or the --site flag.
Localization
The UI defaults to English, with Czech available (lang/en, lang/cs),
controlled by the CP's locale setting. Publish custom translations:
php artisan vendor:publish --tag=statamic-link-checker-translations
Configuration
See config/statamic-link-checker.php — collection scope (collections), site scope
(sites), external/internal check flags, base_url (override base for relative links; null = per-site),
timeout, concurrency, redirect following, error status codes (error_statuses),
excluded patterns (exclude_patterns), check_anchors, check_assets, auto_scan,
history_limit, ignore_file, schedule (enabled/frequency/cron),
notifications (enabled/mail/on), cache store, and pagination.