Support

Account

Home Forums General Issues Flush Unused Custom Fields Reply To: Flush Unused Custom Fields

  • ACF does not create data in the database that it can’t remove. ACF creates an easy to use admin that allows data to be entered. These fields are not in any way different than using the built in custom fields that are provided by WP if you enable the feature. Anything entered here will also never be deleted if you decide not to use the fields again at some future time, that is unless you go into the DB and track it all down to delete it. ACF does not do anything that is not possible without using it, it just makes it easier to use what is already there.

    The only time data is left behind is if you 1) delete a field 2) rename a field 3) delete a field group. Any data previously entered into fields in one of these conditions will linger until the post is deleted.

    When I develop something, when I’m testing something that I may not use, or under any condition that I think I may need to alter or delete fields, I do this work on a development site. Even in the cases where the dev site will become the live site I use temporary posts that I create and these temporary posts are all deleted before live content is entered and this removes any data I may have needed to enter while testing.

    If I find that I must alter a field after a site is live and it contains live data then I try to use the same field name. Depending on the alteration I add logic to my template code that to deal with both the old field and new field if at all possible. If I must delete a field I make a decision at that point if I need that data removed, but the chances of me needing to do this are small because of the way that I do my work.

    I agree, it would be nice if this data was cleaned up, unfortunately, as I said, because of the way that that WP and the DB are built it is not an easy task to accomplish unless a significant amount or forethought is applied.