Home › Forums › Backend Issues (wp-admin) › Update post meta when ACF checkbox choices change › Reply To: Update post meta when ACF checkbox choices change
There isn’t any good way to update field values on all posts when you change field settings.
It is possible if you write PHP. Do a WP_Query() to get all the posts, loop through the posts, get the field, check the values, remove the values for the choices you’ve removed and then update the field if needed.
If the value must be removed on the front end then I would probably build a check where the field was used in the template rather than try to update all of the posts.
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!
Are you building WordPress sites with ACF and @BeaverBuilder, and wanted to use your ACF Blocks in both the block editor and Beaver Builder?— Advanced Custom Fields (@wp_acf) May 10, 2023
The BB team recently added support for using ACF Blocks in Beaver Builder. Check it out 👇https://t.co/UalEIa5aQi
© 2023 Advanced Custom Fields.