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
post_startdatetime
_post_startdatetime
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!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.