If your WordPress blog is old, you will notice lots of custom field meta_keys in your WordPress custom field options.
The problem with this is that you will see lots of unused custom field values which were added by some old themes or plugins which you used a long time ago.
Here is a screenshot of ShoutMeLoud’s custom field which has lots of custom values (many of which are due to old themes or plugins).
Now, if you use a custom field to add values to your blog post, you will probably find these useless meta_keys annoying.
In this post, I will be sharing how you can delete WordPress custom fields from your database.
- IMPORTANT: Do this process at your own risk. Make sure you take a complete backup of your WordPress database.
First, login to your phpMyAdmin account.
You can use the WP-phpMyAdmin plugin to login from your WordPress dashboard.
You will find this option under Tools > phpMyAdmin after you install the WP-phpMyAdmin plugin.
Once you are inside of your WordPress dashboard, click on your database and click on “_postmeta” (on the left sidebar).
You will see options like meta_id, post_id, and meta_key.
You should see something like this screenshot:
On the next page, you will see all your meta_key values along with the number of rows used by them.
For example, in above image, the meta_key “articleimg” has 2 rows. This means that that specific custom field is used in two images. Either I can find those two posts or I can simply delete that value from the database.
I will use the search field to find those two values and will delete them from my WordPress database.
Click on “Search”.
On the next page, simply add the value of the meta_key you wish to search for.
For example, I will search for “articleimg”:
Hit the “Go” button and now simply select both values and delete them from your database.
This way you can get rid of all unwanted WordPress custom field values and keep your blog database neat and clean.
I would suggest that you only perform this task when you are confident enough to do so. It’s not rocket science, but one wrong click can cause you lots of hassle.
I also suggest you try the Advanced database cleaner plugin after this to clean up your WordPress database even further.
I hope you find this tutorial easy to understand. If you have any questions, feel free to ask via the comments section. If you liked this post, don’t forget to share on Facebook, Twitter, and Google Plus!