Support

Account

Home Forums General Issues Postmeta table is hoarding old ACF data?

Solved

Postmeta table is hoarding old ACF data?

  • The plugin Advanced Database Cleaner (https://wordpress.org/plugins/advanced-database-cleaner/) tells me I have 637,000+ orphaned post meta records.

    On closer inspection, I can see that my largest table is wpcxt_13_postmeta – the postmeta table for multisite 13.

    On investigating that table with phpMyAdmin, I can see that the contents of those records is information I have stored in to fields in a “page builder” field group I created in ACF.

    Now, pretty much the only live page of that ilk is page ID 187, but the wpcxt_13_postmeta table shows the same/similar field information stored for a wide range of post_ids, which don’t seem to exist.

    Perhaps those were pages I tried before and deleted?
    Perhaps this is meta “revision” data?

    Is ACF not tidying up after itself properly?

  • ACF does not delete field data when you delete a field or delete a post.

    However, when deleting posts WP should be automatically deleting all post meta that is associated with that post. If it is not then there is something on your site preventing it from doing this cleanup.

    The only time you should have unused data in the post meta table is if you delete a field from ACF. The data will linger until the post that it is related to is deleted.

  • Thanks.

  • Hi there.

    I had the same issue a while ago and didn’t found a proper and safe solutions without a heavy SQL query.

    So I created a plugin using functions by ACF to remove unused metadata.

    Create a database dump and give it a try:
    https://de.wordpress.org/plugins/whatwedo-acf-cleaner/

    Hope it helps not just me

Viewing 4 posts - 1 through 4 (of 4 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.