Remove old custom field after import

I have imported a set of posts to a new WordPress install recently. This OLD set of posts had a set of custom fields attached to it (via post_meta using the ACF plugin). The new installation has almost the same fields, with a couple of exceptions. On the posts that have the old (no longer used) custom fields the back-end is still showing those fields when I go to edit the post, even though I do not have them set up in the CURRENT WordPress installation.

I can only assume this is because the values are in the database (via the import) so WordPress is displaying them.

Read More

How would I go about removing these custom fields and values from the database safely so they do not show up in the post edit screen anymore on the new install?

Related posts

1 comment

  1. As far as I know the custom key-value pairs are kept in the wp_postmeta table. You can simply examine (and delete) them in the database directly.

    SELECT * 
    FROM  wp_postmeta 
    WHERE  meta_key LIKE '%you_old_key_name%'
    

    The ACF configuration of the fields is another story, but you say that you don’t even have the field in the new setup, so you shouldn’t worry about that one.

    Make sure you backup your database before modifying or deleting anything, just in case.

Comments are closed.