Track and analyze asset and entry usage across your Statamic site. Identify which assets and entries are being used, find unused content, and export detailed reports to CSV.
- Asset Usage Tracking: Discover which assets are used on which pages
- Entry Usage Tracking: Track which entries from a specific collection are referenced in other entries
- Unused Content Detection: Identify assets and entries that aren't being used anywhere
- CSV Exports: Export usage reports and unused content lists to CSV files
- Dashboard Widgets: Quick access to exports directly from the Statamic control panel
- Artisan Commands: Export reports via command line for automation and scheduled tasks
- Container Filtering: Filter unused assets by specific asset containers
- Collection Tracking: Track entry usage for any collection (e.g., global blocks, blog posts)
You can install this addon via Composer:
composer require justbetter/statamic-content-usageAfter installation, you'll find two widgets available in your Statamic dashboard:
The Asset Usage widget allows you to:
- Export a report of all assets and where they're used
- Export a list of unused assets (optionally filtered by container)
The Entry Usage widget allows you to:
- Select a collection to track
- Export a report of entries from that collection and where they're referenced
- Export a list of unused entries from that collection
Export a CSV report showing which assets are used on which pages:
php artisan content-usage:export-assetsOptions:
--output=path/to/file.csv- Specify a custom output path (default:storage/app/asset_usage_YYYY-MM-DD_HHMMSS.csv)
Example:
php artisan content-usage:export-assets --output=/tmp/asset-report.csvExport a CSV list of assets that aren't being used anywhere:
php artisan content-usage:export-unused-assetsOptions:
--containers=container1,container2- Filter by specific asset container handles (comma-separated)--output=path/to/file.csv- Specify a custom output path (default:storage/app/unused_assets_YYYY-MM-DD_HHMMSS.csv)
Examples:
# Export all unused assets
php artisan content-usage:export-unused-assets
# Export unused assets from specific containers
php artisan content-usage:export-unused-assets --containers=main,images
# Custom output path
php artisan content-usage:export-unused-assets --output=/tmp/unused.csvExport a CSV report showing which entries from a collection are referenced in other entries:
php artisan content-usage:export-entries --collection=blogOptions:
--collection=handle- Required. The handle of the collection to track--output=path/to/file.csv- Specify a custom output path (default:storage/app/entry_usage_{collection}_YYYY-MM-DD_HHMMSS.csv)
Example:
php artisan content-usage:export-entries --collection=global --output=/tmp/global-usage.csvExport a CSV list of entries from a collection that aren't referenced anywhere:
php artisan content-usage:export-unused-entries blogOptions:
collection- Required. The handle of the collection (as an argument)--output=path/to/file.csv- Specify a custom output path (default:storage/app/unused_entries_{collection}_YYYY-MM-DD_HHMMSS.csv)
Example:
php artisan content-usage:export-unused-entries global --output=/tmp/unused-global.csv| Column | Description |
|---|---|
| Asset Path | The path to the asset file |
| Asset URL | The public URL of the asset |
| Asset Basename | The filename of the asset |
| Page Title | The title of the entry/page using the asset |
| Page URL | The URL of the entry/page |
| Collection | The collection handle of the entry/page |
| Column | Description |
|---|---|
| Entry Title | The title of the referenced entry |
| Entry URL | The URL of the referenced entry |
| Entry Collection | The collection handle of the referenced entry |
| Page Title | The title of the entry/page referencing it |
| Page URL | The URL of the entry/page |
| Page Collection | The collection handle of the referencing entry/page |
| Column | Description |
|---|---|
| Asset Path | The path to the asset file |
| Asset URL | The public URL of the asset |
| Asset Basename | The filename of the asset |
| Container | The asset container handle |
| Column | Description |
|---|---|
| Entry ID | The ID of the unused entry |
| Entry Title | The title of the unused entry |
| Entry URL | The URL of the unused entry |
| Collection | The collection handle |
- Content Cleanup: Identify unused assets and entries that can be safely removed
- Content Audit: Track which global blocks or reusable content is actually being used
- Performance Optimization: Remove unused assets to reduce storage and improve site performance
- Content Strategy: Understand content usage patterns to inform future content decisions
- Migration Planning: Identify orphaned content before migrating or archiving
The addon scans all entries in your Statamic site and:
-
For Assets: Extracts asset references from entry data, including:
assets::prefixed IDs (e.g.,assets::main::image.jpg)- Plain file paths that can be resolved to assets
-
For Entries: Extracts entry references from entry data, including:
entry::collection::idformat references- Plain UUID references that match entries in the tracked collection
The addon then generates comprehensive reports showing relationships between your content.
This addon is licensed under the MIT license.