Home Forums Backend Issues (wp-admin) Updating MySQL Database When Modifying ACF Groups


Updating MySQL Database When Modifying ACF Groups

    • aspsa

    • January 15, 2021 at 10:57 am

    Good day, all. I have been experimenting with ACF’s ‘Group’ and ‘Tab’ layout fields in order to improve their presentation within the WordPress Gutenberg editor for the custom post type I associated with an ACF field group. I noticed the MySQL “postmeta” table retains all the ACF custom field edits, even after I delete the unused fields and sub-fields when devising group and tab configurations.

    Unfortunately, the retained postmeta table ACF field and sub-field records are interfering with the data returned in my custom posts. This may result from the same-named “metakey” column field values, although this should not be an issue since each “postmeta” record is assigned a unique ID value. That is, I used the same ACF custom field “label” and “field” names, but I deleted previous incarnations of the same. I would have assumed ACF purges the appropriate “postmeta” records once their corresponding ACF custom fields & sub-fields are deleted from an ACF custom field group, but this does not seem to be the case.

    To mitigate this issue, I guess I will have to manually delete these records, although I am hesitant to do so, because this may produce orphaned records in the MySQL “posts” table. Therefore, I may need to delete records in the “posts” table as well. This is a hassle, especially when considering the underlying WordPress database structures are very denormalized, making it more tedious to trace the table-to-table relationships.

    Has anyone encountered a similar problem? I would appreciate your feedback. Thank you.

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

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.