2 Ways To Delete Custom Fields From Post Meta Tables

This tutorial is for people that want to get rid of any custom fields that are no longer needed or left over by old plugins or themes.

The easiest way to delete custom fields is to install a plugin like Delete Custom Fields. Otherwise, you can go into phpMyAdmin and delete theme from your database tables manually or use a query.

Delete Custom Fields Plugin

This form will permanently delete custom fields you select along with any content associated with them. Before using this form, please make sure that you are not deleting a custom field used by your theme or plugins; just because you did not explicitly enter or create a custom field does not mean that it does not hold information used by your theme or plugins.

delete custom fields plugin

Caution: Take a full database backup before deleting any custom fields or post meta data.

If you can’t find your custom fields module on all edit post screens, go to Screen Options in the top right hand corner and check then custom fields box to display the module.

Custom Fields Module

Here’s what the custom fields module looks like so you can decide which fields you want to get rid of.

custom fields module

Delete Custom Fields Using phpMyAdmin

If your prefer using phpMyAdmin, here’s the simple steps to removing custom fields manually.

delete wp_postmeta tables

  1. Login to phpMyAdmin and click the database in the left hand sidebar
  2. Click on the post_meta table in the left hand sidebar
  3. In the Sort by key: select PRIMARY (Ascending)
  4. Check the boxes for the custom fields you want to delete
  5. Scroll down to the end of the table and click the delete button to delete all checked fields.

delete post meta fields

That’s it.

Deleting unused custom and post meta fields is easy using phpMyAdmin or a plugin.

You may also want to optimize your database further and remove tables left over by unused and deleted plugins.


Comments

2 responses to “2 Ways To Delete Custom Fields From Post Meta Tables”

  1. Vidhi Verma Avatar
    Vidhi Verma

    Very Nice Article. Thank you so much for sharing. keep posting these useful stuffs I am going to subscribe your future posts. Thanks Again.

Leave a Reply

Join 5000+ Followers

Get The Latest Free & Premium Tutorials Delivered The Second They’re Published.