How to remove all WordPress thumbnai using command line

If you want to free up some space deleting the WordPress thumbnails you can do it via SSH in the command line.

This command deletes every thumbnail regardless if it is being used or not. You might want to use a thumbnail regenerate plugin for that.

This case here is to delete all the garbage in case you want to regenerate them or don't need them anymore.

List the files

List all the thumbnails in the current and sub-directories.

Delete them

You might want to have a backup in case something goes wrong.

About Rick

Senior Front-end Software Engineer from Barcelona, Haidong Gumdo Instructor (korean martial art of the sword), street photographer, travel lover, TV addict, Boston Red Sox fan, and privacy advocate.

Leave a Reply

Add <code> Some Code </code> by using this tags.

*
*