How to Delete Custom Field value from WordPress Database

If your WordPress blog is old, probably you will notice lots of custom field meta_key in your WordPress custom field option. The problem with this is that you will see lots of unused custom field values which is added by some old theme or by plugin which you used long time back.

Here is a screenshot of ShoutMeLoud custom field which has lots of custom value and many of them are because of old theme or plugin.


Now if y0u use custom field to add values to your blog post, probably you might find those useless meta_keys annoying.

In this post, I will be sharing how you can delete  WordPress custom field from database. Though you need to make sure that you do this process with your own risk & don’t forget to take a complete backup of your WordPress blog database.

Login to your phpmyadmin. You can use wp-phpmyadmin plugin to login from your WordPress dashboard.  You will find option under tools> phpmyadmin after you installed wp-phpmyadmin plugin.

Once you are under your WordPress dashboard, click on your database and click on _postmeta (left sidebar). You will see options like meta_id, post_id, meta_key . Something like this screenshot:

meta_key Now select meta_key and click on browse. (Refer above screenshot). On the next page you will see all your meta_key values along with number of rows used by them.

meta values

For example, in above image, meta_key articleimage has two rows. This means that custom field is used in two image. Either I can find those two post or I can simply delete that value from database.

I will use the search field to find those two values and will delete it from my WordPress database.

Click on search on the same page and you might like to open it in a new tab.

search On the next page, simply add value of meta_key you wish to search. For example, I used articleimg as an example.

search-meta-key Hit the go button and now you can simply select both the value and delete it from your database.


This way you can get rid of all unwanted WordPress custom field values and keep your blog neat and clean. Though I would suggest perform this task only when you are confident enough. It’s not rocket science but one wrong click can cost you lots of hassle.

I also suggest you to try clean options WordPress plugin after this to clean your WordPress database.

I hope you find this tutorial easy to understand, if you have any questions, feel free to ask via comments. If you liked this post, don’t forget to share on Facebook and stumble upon.

Subscribe on Youtube

Article By
Harsh Agrawal is a blog scientist and a passionate blogger. He is blogging since 2008 & writes about Blogging, SEO, Make money online & tech. His blog, ShoutMeLoud receives 1 million Pageviews/month and have over 700K subscribers.


COMMENTs ( 8 )

  1. Michael Aulia says

    Thanks, Harsh. I plan to migrate my Platinum SEO plug-in fields/data etc to Thesis and clean up my tables. I’m backing up my database now and will use your guide to help me in cleaning. Cheers

  2. rakesh kumar says

    Thanks harsh, it is great tip and i was initially tried a lots of themes before my own theme. So my blog has a lots of unused fields. so, i am going to use your tricks on my blog.

  3. mahendra says

    Thanks Harsh
    I was looking for it since a long time. I noticed so many useless custom fielld in blog now I can kick out them

  4. HackTik says

    Nice informative post. However, there is wordpress plugin named Plugin Garbage Collector is also available though I am not too sure if that plugin will serve the purpose outlined in this post. If you are going to do this yourself thru phpadmin then you can take the individual backups of the tables you will work on under Operations tab in phpadmin.

  5. Nihar says

    Great tips.

    I did similar thing to delete unused tags. Unused tags will come up if we delete the posts due to some reason but the tags for those delete posts are not deleted..

    I think i have to come up with his post so that it helps others.

    • says

      And it will help you to keep your WordPress database clean. Do try it but with extra precaution..Make sure you take a complete backup of your database before performing above action.