Home › Forums › Add-ons › Flexible Content Field › Problems with keys/values in the database › Reply To: Problems with keys/values in the database
The data can be incorrect if, for example, you have 6 layouts and delete one. The 6th one’s data remains in the database. There isn’t any way to automatically delete ACF data in the database that is no longer used. You’d need to create your own acf/save_post filter and do checking based on your field groups and fields to remove anything that shouldn’t be there.
You can get an accurate count of the layouts on a site. The meta value
'flexiblefield' holds a serialzed array. If you get all of the meta values under this meta key the total count of all of the arrays will be the total count of all layouts for that flex field.
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!
❓Ever wondered when and why ACF uses JSON instead of the database? Check out our summary of the most recent session of ACF Chat Friday for the answer, and make sure to register for the next session.— Advanced Custom Fields (@wp_acf) February 23, 2023
© 2023 Advanced Custom Fields.