How To Delete Custom Field Data From Wordpress (Without PHPMyAdmin)
Here is a quick and easy way to delete custom field data from the Wordpress database left over from old plugins.
One of the joys of WordPress is that it is common for inactive plugins to leave old data in the database. That includes a lot of custom fields. So some people look to delete custom field data from the database.
The plugin might be long gone and not even there anymore, but the custom fields it creates are left behind and just sitting there. And depending on how old your site is or how many plugins you’ve used in the past, you could end up with a lot of custom field data just sitting there doing nothing.
Also, if you have been using something like Advanced Custom Fields and removed any custom fields, it does not remove that data from the database. Even if you cannot see the custom fields anymore in the user interface, the old field values are still sitting there.
Wordpress has no built-in way to remove custom field data. I wish it were there, but I also understand that such functionality could lead to people inadvertently hurting their site. They probably left it out for safety purposes.
Plus, the truth is that it doesn’t really hurt anything for that data to sit there in the database.
A lot of people think they’re going to speed up their sites in a noticeable way by removing this custom field data from the database. But, the reality is that any effect would be so small that it probably wouldn’t even be noticed. MySQL (the database that Wordpress uses) is incredibly fast and having that data sit there really isn’t going to slow things down.
That said… some people just like the feeling of a fresh slate. ๐ And I get it.
Now, the usual way of deleting custom field data from Wordpress is to dive into PHPMyAdmin. You go into the database directly, query the data out of the post_meta table by field name, then delete those rows.
But, there is an easier way.
User Friendly Way To Delete Custom Field Data
You can use the Edit Custom Fields plugin.
This plugin is simplistic. But, it does the job.
First things first… backup your database!
You are about to delete raw data out of your Wordpress database, so definitely run a backup first. If you end up screwing something up, you will have the ability to reverse the damage.
Once the backup is done, go to Tools > Edit Custom Fields.
You will see a big list of all of your custom fields. They will be listed by the raw field name just as they are stored in the database.
Now, it is up to you to figure out what the purpose of those fields are. In some cases, you can tell just by looking. Most plugins will prefix the field name by the name of the plugin itself. If that’s the case, you can quickly determine if those fields are still in use or not.
If you are in doubt about whether a field is used, you can do 2 things:
- Google the field name and see if you can figure out what plugin put it there. Then, act accordingly.
- Just leave the field alone. As I said, it is doing no harm sitting there so if you’re doubtful abbout the safety of deleting it, just leave it be.
To delete custom field data, just check off those fields you’d like to delete. Then, scroll down and hit the button to delete those fields.
You will get a confirmation screen that shows the fields you selected as well as a summary of the posts those fields are attached to.
If everything looks OK, hit the button to confirm and permanently delete the fields.
And that’s it. ๐
You can repeat this process until you delete all the fields you wish to remove.
Keep in mind that this is removing the field DATA. If you used a plugin (like Advanced Custom Fields) to define the field to begin with, this process will not affect that. You would need to delete the fields from there, too.
Got A Question?
Have a question about this article? Need some help with this topic (or anything else)? Send it in and I’ll get back to you personally. I think that’s better than a blog comment. ๐