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.
Pulsecode,
if you need an automate solution try my plugin scan on every acf post save for unused acf or you can complete delete all before save and “resave” the field.
Still need some work but as far as i test works, you can also open a issue on github to improve it.
Works at the moment only on post and custom post type not on the taxonomy but when i have time i will improve the feature.
https://github.com/filippozanardo/redvolver-cleanacf
Try mine https://github.com/filippozanardo/redvolver-cleanacf works well as far as i test work on save i will make a bacth process when i have time.
Let me know
Hi,
try this plugin i just made:
https://github.com/filippozanardo/redvolver-cleanacf
Don’t use in production yet.
Feel free to post comment or pull request.
Cheers
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.