CLI tool to display & purge the uploaded images that currently are not used in any post, page or meta data
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Display or clean unused uploaded images of your Ghost blog

🎁 Install

Run npm install -g ghost-purge-images

🚀 Execute

Login into your server via ssh:

  • Go to the folder where you have installed Ghost, usually in /var/www/ghost
  • Run any command, for example ghost-purge-images display key=YOUR_KEY

🔑 Key

This tool use the Ghost Content API, so you need to provide a Content API Key.

Get a key following this steps:

  • On your Ghost admin, click on Integrations at the left menu
  • Click on green button Add custom integration and set any name
  • Copy the Content API Key and use it

👉 This key can be the same you are using in your Ghostboard account

💡 Need help? Check this step-by-step guide to get a Content API Key

⚡️ Commands

ghost-purge-images display key=YOUR_KEY_HERE

Print the list of all uploaded images that currently are not being used in any post, page or metadata

ghost-purge-images display screenshot

ghost-purge-images purge key=YOUR_KEY_HERE

WARNING: Take a backup before run this

Delete all the unused files.

ghost-purge-images purge screenshot

📋 Changelog


  • Support Ghost Content API
  • Deprecated Ghost Public API
  • Add support for images used in Tags & Authors


  • Support Ghost Public API
  • Support for images in posts, pages, logo & cover

👋 Credits

David Burgos from

✒️ License

See LICENSE file