Skip to content

Conversation

@Marianne380
Copy link
Contributor

What

The deleteAllTerms() function was not properly deleting terms between test runs, causing test pollution and flaky tests.

Why

The WordPress REST API requires the force=true parameter when deleting terms via the API. Without it, the API returns a 501 error:

"Terms do not support trashing. Set force=true to delete.", see https://github.com/WordPress/wordpress-develop/blob/6.9.0/src/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php#L783.

Fix

Add ?force=true to the DELETE request path in deleteAllTerms():

@Marianne380 Marianne380 self-assigned this Jan 16, 2026
@Hug0-Drelon Hug0-Drelon merged commit 8ea10f3 into master Jan 16, 2026
2 checks passed
@Hug0-Drelon Hug0-Drelon deleted the delete-terms-force-parameter branch January 16, 2026 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants