whatwedo ACF Cleaner

აღწერა

We analyze the post of the selected post types against the ACF groups in use. Afterwards we remove all data from deleted groups.
There’s a dry run available (discovery) to see how many fields would get removed. On the actual cleanup you get prompted because it can’t be undone (so make a backup first).

Contribute

Developed with ♥ by whatwedo in Bern.
Thanks to TrilipuT for contributing.

This plugin was initially created for our own usage to clean a big database from old ACF data.

Check out the GitHub repository and submit pull requests or open issues

ეკრანული სურათები

  • The option page for the plugin. You can find it in “Tools / ACF Cleaner”
  • On every post type with unused data the following metabox is shown

დაყენება

The plugin can be found it the WordPress Plugin Directory. Search for “ACF Cleaner”.

Manual Installation

  1. Upload the entire /wwd-acf-cleaner directory to the /wp-content/plugins/ directory.
  2. Activate “whatwedo ACF Cleaner” through the ‘Plugins’ menu in WordPress.
  3. Do a database backup manually or use a third party tool
  4. Go to “Tools / ACF Cleaner”
  5. Select the post types you want to clean and run it

ხდკ

What about conditional fields

Conditional fields are not taken in account at this point. This is probably also the issue why there’s nothing like this baked into the ACF plugin itself. Down the road it gets pretty complex.

Output the names of the deleted fields

We are aware that it would be handy to know which exact fields will get deleted, so the user can analyzing the actual data. This could be integrated in a future release.
We already know the name of the fields and we’re also returning them from the server. Since they’re a lot of unordered data, we don’t do something proper with those in the frontend .

Support more than just post meta

ACF allows fields for term meta, user meta etc and not just post meta. This plugin only works with post meta for now.
There’s a ticket in the WordPress Support page for this: https://wordpress.org/support/topic/support-more-than-just-post-meta/. We’re happy to accept pull requests.

მიმოხილვები

04.07.2024 2 replies
This plugin does a tremendous good job finding and cleaning old and obsolete custom fields from the database. A must-have for database cleanup after development. While it still works OK, it would be nice to see that it is actively maintained and updated. The notice on the plugin’s main page on the WordPress repository can turn away many people from using it. This plugin hasn’t been tested with the latest 3 major releases of WordPress. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress. Devs, are you there?
04.10.2023
I have to admit, it was really bugging to know that I had all manner of ACF fields that I had replaced, reconfigured, abandoned etc. during the dev process, and when using any theme builder to assign ACF fields to various modules, I was seeing fields that I had long ago abandoned. In one case I went from a custom field in a CPT, to a taxonomy for that CPT, and I used the same name, so that field was still in the database with some values entered for it, and in my theme builder I saw two different field assignment options with the same name ;-( Yes, I could work around that, and it is not bringing my site to a crawl or anything to have the superfluous fields in there. But I was able to use this plugin to easily remove that field, along with a few others I knew I wanted to remove, and even some I had forgotten about. So kudos for giving folks like us a way to clean all this obsolete stuff out of the db.
19.09.2023
I found myself changing a lot of ACF fields recently that were deprecated or required different input formats – what I didn’t expect was that the old input data would be forever saved in the database (even after deleting those fields!). This plugin serves a great purpose to clean up old and unused data from your database, which means you can retain better database connection speeds and reduce database bloat. Awesome work and thank you. 👌
08.02.2023
Good idea, deletion went ok.It is not possible to check what the plugin actually deleted.As a result of the deletion, all products that had ACFs stopped being displayed. So I restored the database and (I still have 150 fields that I need to delete completely – globally)I continue to use ACF, but some fields simply cannot be removed from DTBIf an update is made to some functions, then it will be possible to work with this tool. But now 3x Star
02.04.2021 1 reply
Amazing, just found this via the long thread in the ACF forum, like to check in now and then to see if some good solution have entered, and today was the day! Amazing work guys, appriascted you shared this plugin in the offical repo it works great. The only think I’m missing right now was as you already have confirmed in the FAQ. Output the names of the deleted fields but both for scan and delete so we know before the hit delete. Wasn’t sure if it managed to findd the orphan meta fields from options pages? But sure this is a 5 out ot 5 stars even if some minor things coudl be asked for. I hope this could en ter active development we are many that would like to support even for a paid upgrade for more features. Hands down the only and best working ACF bulk clean orphan meta fields. Whatweasked for – whatwedo
6 რევიუს წაკითხვა

მონაწილეები & დეველოპერები

“whatwedo ACF Cleaner” ღია პროგრამული უზრუნველყოფაა. შემდეგმა ადამიანებმა წვილი შეიტანეს მის განვითარებაში.

მონაწილეები

გადათარგმნეთ whatwedo ACF Cleaner თქვენს ენაზე.

დაინტერესებული ხართ დეველოპმენტით?

დაათვალიერეთ კოდი, შეამოწმეთ SVN რეპო, ან გამოიწერეთ შექმნის ჟურნალი : RSS.

ცვლილებები

1.2.2 (2024-10-01)

  • Test if everything still works with WordPress 6.6 and PHP 8.3 and bump versions for the WP repo

1.2.1 (2023-05-25)

  • Prevent error when no clone field is used (thanks to melcarthus for reporting)

1.2.0 (2023-04-20)

  • Find more orphans (repeater and clone fields)
  • Improve loading of plugin when included via a theme
  • Return notice when Advanced Custom Fields is not installed
  • Show more CPT in the list (also not public once are visible now)

1.1.0 (2022-07-14)

  • Add single post metabox with detailed info for unused fields (thanks to TrilipuT)
  • More precise unused fields detection added (thanks to TrilipuT)
  • Add check if Advanced Custom Fields is installed (thanks to sebastian_a) for reporting it

1.0.0 (2020-02-22)

  • First release