Home › Forums › General Issues › Flush Unused Custom Fields › Reply To: Flush Unused Custom Fields
Annoyingly i’ve already deleted all my fields and check this useful thread a bit too late to read the clean on delete possibilities.
I’ve got around 4,000 posts with a lot of dead meta.
Couldn’t this be achieved with a bit of SQL? Trying to piece it together but not my strongest field!
post_type=’acf-field’, post_excerpt seems to be the name of the field in this case ‘post_startdatetime’
post_meta.meta_key is then like this
So if the post_type=’acf-field’ are deleted could we loop through the post_meta.meta_key, check if there’s a matching posts.post_excerpt and if not delete the post_meta entry?
But there’s there’s an entry per post with a name like ‘field_534fe013d9a0d’ though we would still get 75% of unused post_meta.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
ACF wouldn’t be so widely used in WordPress if it didn’t have some pretty amazing capabilities. In this article, we look at a few of the features we’ll discuss during “7 things you didn’t know you could do with ACF” at #WPEDecode later this month. https://t.co/5lnsTxp81j pic.twitter.com/Yf0ThPG1QG— Advanced Custom Fields (@wp_acf) March 16, 2023
© 2023 Advanced Custom Fields.