PHPackages                             swiftmade/statamic-clear-assets - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. swiftmade/statamic-clear-assets

ActiveStatamic-addon[Utility &amp; Helpers](/categories/utility)

swiftmade/statamic-clear-assets
===============================

Deletes unused assets. Saves storage space.

v3.4.0(3mo ago)1946.0k↓57.4%4MITPHPPHP ^7.4|^8.0CI passing

Since May 14Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/swiftmade/statamic-clear-assets)[ Packagist](https://packagist.org/packages/swiftmade/statamic-clear-assets)[ Docs](https://statamic.com/addons/swiftmade/clear-assets)[ GitHub Sponsors](https://github.com/swiftmade)[ RSS](/packages/swiftmade-statamic-clear-assets/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (10)Dependencies (12)Versions (13)Used By (0)

Statamic Clear Assets
=====================

[](#statamic-clear-assets)

[![Statamic 3.0+](https://camo.githubusercontent.com/93c61a311851e398f5663226aca5d307d91ef898067c6b294110a785d6c2e735/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f53746174616d69632d332e302b2d4646323639453f7374796c653d666f722d7468652d6261646765266c696e6b3d68747470733a2f2f73746174616d69632e636f6d)](https://camo.githubusercontent.com/93c61a311851e398f5663226aca5d307d91ef898067c6b294110a785d6c2e735/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f53746174616d69632d332e302b2d4646323639453f7374796c653d666f722d7468652d6261646765266c696e6b3d68747470733a2f2f73746174616d69632e636f6d)[![Latest Version on Packagist](https://camo.githubusercontent.com/c684f6cffb54802c3b835e9719e0ecdc07633485d70b27ebafd960564515ff3f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73776966746d6164652f73746174616d69632d636c6561722d6173736574732e7376673f7374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/swiftmade/statamic-clear-assets)[![Downloads](https://camo.githubusercontent.com/fe541a8af693e89c519639a1baa566b0d750699d9fe4403d31a0ba6d34088bc4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73776966746d6164652f73746174616d69632d636c6561722d6173736574733f7374796c653d666f722d7468652d6261646765)](https://camo.githubusercontent.com/fe541a8af693e89c519639a1baa566b0d750699d9fe4403d31a0ba6d34088bc4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73776966746d6164652f73746174616d69632d636c6561722d6173736574733f7374796c653d666f722d7468652d6261646765)

> Supports Statamic 3, 4, 5 and 6.

Clean up unused images and assets from your Statamic site. Saves storage, keep things tidy.

The 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.

The addon is easy to configure. See the [Configuration](#configuration) section below.

[![demo](demo.gif)](demo.gif)

How to Install
--------------

[](#how-to-install)

You can search for this addon in the `Tools > Addons` section of the Statamic control panel and click **install**, or run the following command from your project root:

```
composer require swiftmade/statamic-clear-assets
```

How to Use
----------

[](#how-to-use)

Simply run:

```
php please assets:clear
```

It 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.

If you want to skip the interactive mode, you can use the `--force` flag:

```
# This will delete all the unused assets without asking for confirmation!
php please assets:clear --force=true
```

Configuration
-------------

[](#configuration)

To publish the config file, use:

```
php artisan vendor:publish --tag=statamic-clear-assets-config
```

Here's all of the configuration options with their defaults:

```
return [

    /**
     * Where should we look to see if assets are still referenced or not?
     * If you're referencing assets elsewhere in your codebase, add those paths here.
     * All paths are relative to the base_path()
     */
    'scan_folders' => [
        'content',
        'users',
    ],

    /**
     * All assets from these containers will be left alone.
     * You can see all your asset containers under content/assets folder.
     */
    'ignore_containers' => [
        'favicons',
        'social_images',
    ],

    /**
     * If we come across these filenames, we'll just leave them alone.
     * You can use "*" as a wildcard. eg: "IMAGE*.jpg" will ignore IMAGE1.jpg IMAGE23.jpg etc...
     */
    'ignore_filenames' => [
        //
    ],

    /**
     * You might not want to delete very fresh assets, as perhaps you want to use them soon.
     * Use this config to only detect and delete files older than x days.
     */
    'minimum_age_in_days' => 0,
];
```

Common Questions
----------------

[](#common-questions)

**It's deleting assets that I'm referencing in my antlers templates!**

If 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.

**How do I always keep PDF files?**

Add `*.pdf` to the `ignore_filenames` config.

**How do I always keep assets from a specific container?**

Add the container's slug to the `ignore_containers` config.

**How do I only delete assets older than 30 days?**

Set `minimum_age_in_days` to `30` in the config.

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance82

Actively maintained with recent releases

Popularity39

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 95.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~156 days

Recently: every ~171 days

Total

10

Last Release

98d ago

Major Versions

v1.2.0 → v2.0.02023-06-07

v2.0.1 → v3.0.02024-05-10

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/735011?v=4)[Ahmet Özışık](/maintainers/aozisik)[@aozisik](https://github.com/aozisik)

---

Top Contributors

[![aozisik](https://avatars.githubusercontent.com/u/735011?v=4)](https://github.com/aozisik "aozisik (20 commits)")[![laravel-shift](https://avatars.githubusercontent.com/u/15991828?v=4)](https://github.com/laravel-shift "laravel-shift (1 commits)")

---

Tags

laravelphpstatamicstatamic-addonstatamic-v3statamic-v4statamic-v5

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/swiftmade-statamic-clear-assets/health.svg)

```
[![Health](https://phpackages.com/badges/swiftmade-statamic-clear-assets/health.svg)](https://phpackages.com/packages/swiftmade-statamic-clear-assets)
```

###  Alternatives

[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135224.7k7](/packages/statamic-rad-pack-runway)[duncanmcclean/statamic-cargo

Comprehensive e-commerce addon for Statamic. Build bespoke e-commerce sites without the complexity.

3416.9k](/packages/duncanmcclean-statamic-cargo)[statamic/seo-pro

68516.6k](/packages/statamic-seo-pro)[marcorieser/statamic-livewire

A Laravel Livewire integration for Statamic.

23111.5k14](/packages/marcorieser-statamic-livewire)[aerni/livewire-forms

A Statamic forms framework powered by Laravel Livewire

2915.1k](/packages/aerni-livewire-forms)[aerni/advanced-seo

Comprehensive SEO addon for Statamic with flexibility in mind

1818.2k](/packages/aerni-advanced-seo)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
