After modifying how certain metadata works with Posts, I’ve decided to delete a field group that is now no longer needed.
BUT a number of posts still have that metadata associated.
Just as a matter of hygiene, I’d like to remove that meta key and values from those posts, but I do not have the SQL skills to write the query myself. I DO have access via phpMyAdmin, and am skilled enough to use it (always carefully and after backing up first!), but I could use some help in writing the query that will search the wp_postmeta table, find those Posts that have that metakey, and delete the key and it’s value.
Why don’t you add this feature to the plugin itself, when someone removes any custom field from the group, please try storing them in a list and then either you can add an option to allow deleting them from DB, or we will at least have key and can delete them all in a run. Sometimes we do it in a hurry and lots of the fields remain there for lifetime, so we should have at least some option.
Respectfully I echo er.mayankrajput’s suggestion for consideration in a future update…..an option to delete – or not – the data already stored in the DB that is associated with the field (or repeater row) being deleted.
Viewing 6 posts - 1 through 6 (of 6 total)
The topic ‘Removing data from WP db after deleting a field group’ is closed to new replies.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users