Home › Forums › General Issues › Sync deleted fields with JSON? › Reply To: Sync deleted fields with JSON?
That explains a lot. ACF will not delete entire field groups if they are missing from the acf-json folder. What you are seeing is expected behavior. ACF will only save changes, load groups, and sync groups that exist in the folder.
I you want to automatically delete groups, I’m sure it would be possible, but you’d need to right custom code to detect the missing files and tell ACF to delete them. I don’t know of any examples of doing this or the code that would be involved, but basically you’d need to get a list of all the groups and see if there is a corresponding json file and if not then tell ACF to delete the group.
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!
The most recent ACF Chat Friday featured a live demo of how to register CPTs directly in the plugin, one of our most requested features. Check out the summary below for a replay of the demo, and don’t forget to register for the next session! https://t.co/k2KQ3WWBAz
— Advanced Custom Fields (@wp_acf) March 9, 2023
© 2023 Advanced Custom Fields.
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.