Remove Collection Field data from Entry when Field is deleted?

It’s not a bug - it’s a feature, but I see the problem.

Keeping only active fields is probably a bad idea, because there are a lot of hidden fields, e. g.:

  • meta info _created, _modified etc.
  • localized fields with language code suffixes title_de
  • auto generated slugs title_slug
  • some addons create hidden meta fields, e. g. UniqueSlugs…

But there is a cli command to fix that behaviour.

cd /path/to/cockpit
php ./cp collection/removefield --collection <collection name> --field <field name>
cd /path/to/cockpit
php ./cp collection/renamefield --collection <collection name> --field <field name> --newfield <new field name>

See: https://github.com/agentejo/cockpit/tree/next/modules/Collections/cli/collection

Both cli commands change the contents in the database, but they don’t change the field definitions in your collection settings. So performing the simple step of renaming/deleting a field is a bit complicated, but the tools to handle visible and hidden fields are available.