If you use an autotagging plugin in WordPress and you remove some posts, you may have tags left over in your database that are no longer being used. Since I’ve had that problem and couldn’t find a plugin to do what I wanted, I decided to write a script to remove those. You can see the source of this at https://randomlinux.com/tagremover.
To use this, you will need to ssh into your server and run the following command in the same directory as your wp-config.php file.
wget https://randomlinux.com/tagremover && sh tagremover
That will run the file, show your unused tags and prompt you to delete them. Keep in mind that this has only been tested on a few sites, so your results are not guaranteed and I am not responsible for anything that happens. Be sure to take a backup of your database, just in case. Come to think of it, I’ll make it do that automatically in the next update 🙂
We would love feedback on the script, as well as anything that would be beneficial to you that could be added!
Chris October 11th, 2011
Posted In: Uncategorized