Docs / Category & Tag Trash
Category & Tag Trash
A trash for categories, tags and custom terms, with undo and full restore.
Hooks
Every default, limit and message has a filter, and every change fires an action.
axle_category_tag_trash_supports_taxonomyFilter( bool $keep, string $taxonomy )Return false to delete a taxonomy’s terms for good, as WordPress normally does. Menus (nav_menu) are never kept
axle_category_tag_trash_keep_termFilter( bool $keep, WP_Term $term )Whether one deleted term goes to the trash, for example to let empty tags go for good
axle_category_tag_trash_retention_daysFilter( int $days )Days a trashed term is kept. Wins over the setting on the screen
axle_category_tag_trash_retention_choicesFilter( int[] $days )Periods offered on the screen. Default 7, 30, 90 and 365
axle_category_tag_trash_undo_secondsFilter( int $seconds )How long the Undo notice after a bulk delete stays. Default 300
axle_category_tag_trash_trashedAction( int $item_id, Snapshot $snapshot )A deleted term landed in the trash
axle_category_tag_trash_deletedAction( int $item_id, Snapshot $snapshot )A trashed term is about to be deleted for good: Empty trash, Delete permanently or the daily clean-up. Not on restore
axle_category_tag_trash_purgedAction( int $deleted )The daily clean-up deleted this many expired terms
axle_category_tag_trash_restoredAction( int $term_id, string $taxonomy, Snapshot $snapshot, int[] $object_ids )Fires once the term is back. $object_ids holds the objects re-attached in that request, at most 5,000
axle_category_tag_trash_objects_restoredAction( int $term_id, string $taxonomy, int[] $object_ids )Fires for every batch of objects re-attached, in the request and in the background
axle_category_tag_trash_restore_completeAction( int $term_id, string $taxonomy, Snapshot $snapshot )Fires once every object is back
axle_category_tag_trash_restore_batch_sizeFilter( int $size )Objects re-attached per request or cron run. Default 5000
axle_category_tag_trash_capabilityFilter( string $capability )Capability for Tools > Axle Category & Tag Trash. Default manage_categories. Each restore and delete still checks the term’s own taxonomy
No hook matches that. Try a shorter word.
WP-CLI
wp axle-category-tag-trash list [--taxonomy=<taxonomy>] [--format=table|csv|json|count|ids]
wp axle-category-tag-trash restore <id>...
wp axle-category-tag-trash delete <id>...
wp axle-category-tag-trash delete --all [--yes]Abilities
What AI agents can do through the WordPress Abilities API and MCP, with the same permissions as the screen.
axle-category-tag-trash/listRead-only. Trashed terms, newest first, with what a restore brings back. Input: taxonomy, search, limit, page
Who can run it: the Axle Category & Tag Trash capability. Terms of taxonomies you cannot manage are left out
axle-category-tag-trash/restoreRestores trash item id with its posts, child terms and menu links
Who can run it: the Axle Category & Tag Trash capability and the term’s own taxonomy
axle-category-tag-trash/deleteDeletes trash item id for good. Destructive, so the REST API runs it with DELETE
Who can run it: the Axle Category & Tag Trash capability and the term’s own taxonomy
The full reference, with the PHP API and examples, is in REFERENCE.md for version 3.0.0