{"id":36987304,"url":"https://github.com/swiftmade/statamic-clear-assets","last_synced_at":"2026-01-13T23:06:43.187Z","repository":{"id":38417774,"uuid":"492267948","full_name":"swiftmade/statamic-clear-assets","owner":"swiftmade","description":"Clean up unused images and assets from your Statamic site.  Saves storage, keep things tidy.","archived":false,"fork":false,"pushed_at":"2025-09-13T18:00:36.000Z","size":896,"stargazers_count":18,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-22T08:42:03.657Z","etag":null,"topics":["laravel","php","statamic","statamic-addon","statamic-v3","statamic-v4","statamic-v5"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/swiftmade.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"swiftmade"}},"created_at":"2022-05-14T16:25:01.000Z","updated_at":"2025-09-13T18:00:18.000Z","dependencies_parsed_at":"2024-02-01T22:07:40.335Z","dependency_job_id":"28a7c31a-7ae7-4272-bccd-fe2cf1eb7d7c","html_url":"https://github.com/swiftmade/statamic-clear-assets","commit_stats":{"total_commits":10,"total_committers":1,"mean_commits":10.0,"dds":0.0,"last_synced_commit":"69166cd76b7bd07c87e1ec01552784b1bdf76adf"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/swiftmade/statamic-clear-assets","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swiftmade%2Fstatamic-clear-assets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swiftmade%2Fstatamic-clear-assets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swiftmade%2Fstatamic-clear-assets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swiftmade%2Fstatamic-clear-assets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/swiftmade","download_url":"https://codeload.github.com/swiftmade/statamic-clear-assets/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swiftmade%2Fstatamic-clear-assets/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28405132,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T21:51:37.118Z","status":"ssl_error","status_checked_at":"2026-01-13T21:45:14.585Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["laravel","php","statamic","statamic-addon","statamic-v3","statamic-v4","statamic-v5"],"created_at":"2026-01-13T23:06:42.529Z","updated_at":"2026-01-13T23:06:43.179Z","avatar_url":"https://github.com/swiftmade.png","language":"PHP","readme":"# Statamic Clear Assets\n\n![Statamic 3.0+](https://img.shields.io/badge/Statamic-3.0+-FF269E?style=for-the-badge\u0026link=https://statamic.com)\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/swiftmade/statamic-clear-assets.svg?style=for-the-badge)](https://packagist.org/packages/swiftmade/statamic-clear-assets)\n![Downloads](https://img.shields.io/packagist/dt/swiftmade/statamic-clear-assets?style=for-the-badge)\n\n\n\n\u003e Supports Statamic 3, 4 and 5.\n\nClean up unused images and assets from your Statamic site. Saves storage, keep things tidy.\n\nThe addon scans your entire `content` and `users` directory. If an asset is not referenced anywhere, it will be marked as unused. You can review the list of unused assets and delete them.\n\nThe addon is easy to configure. See the [Configuration](#configuration) section below.\n\n![demo](demo.gif)\n\n## How to Install\n\nYou can search for this addon in the `Tools \u003e Addons` section of the Statamic control panel and click **install**, or run the following command from your project root:\n\n```bash\ncomposer require swiftmade/statamic-clear-assets\n```\n\n## How to Use\n\nSimply run:\n\n```bash\nphp please assets:clear\n```\n\nIt will list all the assets that are not referenced anywhere in your content directory. You can delete them all at once, or one by one.\n\nIf you want to skip the interactive mode, you can use the `--force` flag:\n\n```bash\n# This will delete all the unused assets without asking for confirmation!\nphp please assets:clear --force=true\n```\n\n## Configuration\n\nTo publish the config file, use:\n\n ```bash\n php artisan vendor:publish --tag=statamic-clear-assets-config\n ```\n\nHere's all of the configuration options with their defaults:\n\n```php\nreturn [\n\n    /**\n     * Where should we look to see if assets are still referenced or not?\n     * If you're referencing assets elsewhere in your codebase, add those paths here.\n     * All paths are relative to the base_path()\n     */\n    'scan_folders' =\u003e [\n        'content',\n        'users',\n    ],\n\n    /**\n     * All assets from these containers will be left alone.\n     * You can see all your asset containers under content/assets folder.\n     */\n    'ignore_containers' =\u003e [\n        'favicons',\n        'social_images',\n    ],\n\n    /**\n     * If we come across these filenames, we'll just leave them alone.\n     * You can use \"*\" as a wildcard. eg: \"IMAGE*.jpg\" will ignore IMAGE1.jpg IMAGE23.jpg etc...\n     */\n    'ignore_filenames' =\u003e [\n        //\n    ],\n\n    /**\n     * You might not want to delete very fresh assets, as perhaps you want to use them soon.\n     * Use this config to only detect and delete files older than x days.\n     */\n    'minimum_age_in_days' =\u003e 0,\n];\n```\n\n## Common Questions\n\n**It's deleting assets that I'm referencing in my antlers templates!**\n\nIf you want to ignore the assets referenced in your views, add `resources/views` to the `scan_folders` config. Keep in mind that this will only work if the filename is mentioned verbatim in the code. If you are using variables or other logic to reference the asset, the addon might not be able to detect that the asset is being used.\n\n**How do I always keep PDF files?**\n\nAdd `*.pdf` to the `ignore_filenames` config.\n\n**How do I always keep assets from a specific container?**\n\nAdd the container's slug to the `ignore_containers` config.\n\n**How do I only delete assets older than 30 days?**\n\nSet `minimum_age_in_days` to `30` in the config.\n\n","funding_links":["https://github.com/sponsors/swiftmade"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswiftmade%2Fstatamic-clear-assets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fswiftmade%2Fstatamic-clear-assets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswiftmade%2Fstatamic-clear-assets/lists"}