Home › Forums › General Issues › Flush Unused Custom Fields › Reply To: Flush Unused Custom Fields
Hi all,
if you look at my try to achieve this:
https://github.com/filippozanardo/redvolver-acfcleaner
You see that ,expect some field that i didn’t found a way yet, can be made in 2 ways, one is as john say delete all the meta related to ACF on acf/save_post hook at high priority.
The other a more difficcult way is to match the field in the database/json and then to delete the field that is not present anymore in the current saved data.
I found a trick also to check if the field is a flexible field and delete the field.
As far as i test works remember to backup db first.
For now works on post and custom post type when i have time i want also to include a “Clean all ACF” tool that use this method, and i’m trying also to find a way to “clean” all the fields for taxonomy, user etc etc.
Suggestions, ideas and pull requests are welcome.
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.