AdvancedCustomFields / AdvancedCustomFields/acf

Cleaning unused meta fields. Custom addon development

Open
#865 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
945
Forks
197
PR merge metrics
No merged PRs in 30d

Description

Hi, we are making an addon, that cleans up all acf related meta fields, that are no longer registered in dashboard.

Logic is:

  • We query all meta_keys which have a copy with underscore.
  • Then we check if referenced in underscore meta field is still registered
  • if not - we remove it.

However, we found out, that fields that are registered from code, not from dashboard are also removed this way.
Is there a recommended way for "code registered" fields to appear in the database as well? or any other recommendation to avoid them being deleted?

Thank you!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue describes an addon that queries ACF meta keys and removes fields no longer registered in the dashboard. Start by reviewing how code-registered fields are represented and persisted in ACF, then determine whether a supported registration or cleanup mechanism exists. Done would require a documented, agreed approach that prevents valid code-registered fields from being deleted.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend, databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.