• X

    How to Delete Custom Field value from WordPress Database

    By in WordPress

    Bluehost hosting

    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.

    unusedcustomfield thumb How to Delete Custom Field value from WordPress Database

    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 thumb How to Delete Custom Field value from WordPress Database 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.

    metavalues thumb How to Delete Custom Field value from WordPress Database

    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 thumb How to Delete Custom Field value from WordPress Database On the next page, simply add value of meta_key you wish to search. For example, I used articleimg as an example.

    searchmetakey thumb How to Delete Custom Field value from WordPress Database Hit the go button and now you can simply select both the value and delete it from your database.

    deletevalues thumb2 How to Delete Custom Field value from WordPress 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.

    Get Free Blogging updates in your Email

    Find more Topics based on Keywords

    Article by

    Harsh has written 1264 articles.

    If you like This post, you can follow ShoutMeLoud on Twitter. Subscribe to ShoutMeLoud feed via RSS or EMAIL to receive instant updates.

    { 9 comments… read them below or add one }

    Himanshu

    this something new. will try this for sure.

    Reply

    Harsh Agrawal

    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.

    Reply

    Nihar

    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.

    Reply

    HackTik

    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.

    Reply

    mahendra

    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

    Reply

    Santhosh

    Thanks Harsh, I Start Cleaning unused fields

    Reply

    Robin

    This is great at last I don’t need any plugin. Thanks

    Reply

    rakesh kumar

    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.

    Reply

    Michael Aulia @CravingTech.com

    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

    Reply

    Leave a Comment

    Previous post:

    Next post:

    `