WordPress Suicide

WordPress logoThis was a fun one to write. What if you wanted to start over again? Just wipe the slate clean and start blogging without any baggage. Well, that’s actually hard to do unless you’re comfortable using the MySQL command line client (or phpMyAdmin).

So I whipped up a little plugin that does just that, and no more. Install it, activate it, and you’re just a single click away from blogging salvation (or is it purgatory?). In other words, this plugin gives you the power to delete all your blog posts from the database in one fell swoop. You can also use it to delete categories, comments, links, and custom fields, as well as users and blog settings. Here’s a screenshot:

Screenshot of WordPress Suicide plugin

Instructions

  1. Download Suicide v2.0 from the WordPress.org Plugin Directory (or from me here)
  2. Unzip the file and upload the suicide folder to your wp-content/plugins/ directory
  3. Activate the plugin
  4. Go to Tools > Suicide (and contemplate your blogging fate)

Note: by default, this plugin will delete all content associated with your blog except users and settings. That way you’re left with a functional, though effectively empty blog. Consider backing up your blog before “committing Suicide”. I assume no liability for data loss suffered through the use of this plugin. Use at your own risk!

In all seriousness, you might want to use this plugin if you recently imported your posts into WordPress from another blogging platform but something went horribly wrong (or you were considering importing your Haloscan comments) and you want to start the import process over.

Update: If you want more nuanced control over what particular records get deleted, say based on date or some other criteria, check out my SQL Executioner plugin. It allows you to send any SQL query/command to your WordPress database. If you don’t know SQL, no worries, just leave a comment with what you want, and I (or someone else) will respond with a query you can try.

Questions, comments, and suggestions are always welcome. If you’re interested in contributing to the code behind Suicide, it’s hosted on GitHub.

Feel free to if you found this useful.