WP Plugin: Delete Custom Fields
As I wrote a couple of days ago I had updated my blog. While doing so I noticed that my database was about 4omb, which is just too big as I knew that my database ain’t that big. So I needed to investigate that.
After a quick look at the database it turned out that:
- One of my plugins which I use was eating 20mb of space!
- 6000 spam comments weren’t deleted yet and were still in my database.
- wp_postmeta table contained more then 10.000 rows which I found too much for this table…
Solving the first two points was no problem at all but how was I going to check the 10.000 rows within wp_postmeta? I knew that this table is used to store meta data of posts. What I didn’t knew is that some plugin add their own information on this table as well, thanks to the database description of WordPress.org! So I figured: what if all the data of the plugins and themes are still in my database? I mean I have tried several plugins and themes during years.
Delete Custom Fields Plugin:
After a research I saw that someone had more or less the same problem as I had and someone else advised him to check a plugin Delete Custom Fields. This got me thinking and I installed the plugin. Within seconds I saw that a lot of old information were still in my database such as my old theme’s custom fields, information of several plugins and more. I started deleting them, off course only the ones I knew that I didn’t use, and when I was done I had 4.046 rows left which were 1.5mb’s! A huge difference! The database is now about 11mb big so this is more like it!
So if you have switched to a new theme, or have been testing with new themes and/or plugin, then some data might be stored in the database. The easiest way to get rid of those information is by simply run this plugin. Assuming that the theme and/or the plugin uses custom fields to store their data, Delete Custom Fields plugins will let you delete every instance of a custom field from your site. This will not only save you some space in your database but it’ll also make sure that the old custom fields wouldn’t appear in your list of custom fields when you edit a post or page!
NOTE: as always make a backup of the database before you start with this plugin as there’s no way to restore the data once it has been deleted!