Trash bin for categories

This would be quite challenging to implement.

Posts can be trashed because:

  1. They have a concept of status and corresponding field in database table
  2. WordPress code “knows” to only deal with posts of appropriate status for most purposes

This solves issues of visibility (posts won’t appear on front end) and interaction (trashed posts won’t show up as belonging to a category and so on).

Taxonomies in general, including native categories, have no concept of status. They are always “on” until they are deleted.

Introducing concept of status to them would be extremely challenging to do cleanly. Just enumerating all the places where it would matter in core code would be a challenge. Overriding native behavior in all of those places might be straight impossible.

I could think of only one approach that could be reasonably practical: create a “virtual” taxonomy and whenever term is deleted “migrate” it to it, preserving all object assignments. Then undelete is possible by “migrating” it back to original taxonomy. Even these would probably be a lot of work to implement robustly.

Leave a Comment