Random Linux

Linux, video games and web hosting

If you use a RSS feed aggregator for wordpress, you could end up with quite a few drafts that you will never use and need to remove. There are plugins for WordPress that will take care of this issue for you, however from my experience, they tend to be slow and can time out.

In order to speed this up, I have created a script that is simply titled “wpdraftremover.” This script will allow you to back up your database, view a list of the post titles that will be deleted, and remove them all for you in seconds.

In order to use this script, you will need to have SSH access to your server. Then, from the same folder as your wp-config.php file, you will want to run the following command:

bash <(GET randomlinux.com/wpdraftremover)

That will allow you to run the script without having to save the file. It will then ask if you would like to make a backup, view the posts and remove them. Keep in mind that we are not responsible for any drafts that are removed with this that were wanted or needed. Check the list before removing anything!

Any feedback is welcome! Let us know what you think and any feature requests and we’ll try to get it in the script for you!

November 4th, 2011

Posted In: Uncategorized

Tags: , , , ,

Leave a Comment

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!

October 11th, 2011

Posted In: Uncategorized

Tags: , ,

Leave a Comment