WordPress accumulates post revisions, auto-drafts, trashed posts, and overhead over time. This slows down database queries.
Solution
Clean post revisions, auto-drafts, trashed posts, spam comments, and optimize database tables.
User Stories
As a site owner, I want to clean post revisions, so that database size is reduced
As a site owner, I want to clean auto-drafts, so that stale content is removed
As a site owner, I want to clean trashed posts, so that deleted content is removed
As a site owner, I want to clean spam comments, so that database is cleaner
As a site owner, I want to clean orphaned post meta, so that database integrity is maintained
As a site owner, I want to optimize database tables, so that query performance improves
As a site owner, I want to schedule automatic cleanup, so that maintenance is automated
As a site owner, I want to see database statistics before cleanup, so that I can make informed decisions
As a site owner, I want to exclude specific post types from cleanup, so that important data is preserved
As a site owner, I want a dry-run mode, so that I can preview changes before applying
As a site owner, I want backup before cleanup, so that I can restore if needed
As a site owner, I want cleanup logs, so that I can audit what was removed
Implementation Decisions
Direct SQL queries for cleanup operations
WordPress options API for scheduling
Transient API for storing statistics
Admin page for manual trigger and settings
Batch processing for large databases
Logging via custom log file or WordPress debug log
Testing Decisions
Test post revisions are cleaned
Test auto-drafts are cleaned
Test trashed posts are cleaned
Test spam comments are cleaned
Test orphaned meta is cleaned
Test table optimization runs
Test scheduled cleanup works
Test dry-run mode works
Out of Scope
Cache purging (separate feature)
Object caching (separate feature)
Further Notes
Database optimization should work independently of caching.
## Problem Statement
WordPress accumulates post revisions, auto-drafts, trashed posts, and overhead over time. This slows down database queries.
## Solution
Clean post revisions, auto-drafts, trashed posts, spam comments, and optimize database tables.
## User Stories
1. As a site owner, I want to clean post revisions, so that database size is reduced
2. As a site owner, I want to clean auto-drafts, so that stale content is removed
3. As a site owner, I want to clean trashed posts, so that deleted content is removed
4. As a site owner, I want to clean spam comments, so that database is cleaner
5. As a site owner, I want to clean orphaned post meta, so that database integrity is maintained
6. As a site owner, I want to optimize database tables, so that query performance improves
7. As a site owner, I want to schedule automatic cleanup, so that maintenance is automated
8. As a site owner, I want to see database statistics before cleanup, so that I can make informed decisions
9. As a site owner, I want to exclude specific post types from cleanup, so that important data is preserved
10. As a site owner, I want a dry-run mode, so that I can preview changes before applying
11. As a site owner, I want backup before cleanup, so that I can restore if needed
12. As a site owner, I want cleanup logs, so that I can audit what was removed
## Implementation Decisions
- Direct SQL queries for cleanup operations
- WordPress options API for scheduling
- Transient API for storing statistics
- Admin page for manual trigger and settings
- Batch processing for large databases
- Logging via custom log file or WordPress debug log
## Testing Decisions
- Test post revisions are cleaned
- Test auto-drafts are cleaned
- Test trashed posts are cleaned
- Test spam comments are cleaned
- Test orphaned meta is cleaned
- Test table optimization runs
- Test scheduled cleanup works
- Test dry-run mode works
## Out of Scope
- Cache purging (separate feature)
- Object caching (separate feature)
## Further Notes
Database optimization should work independently of caching.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Problem Statement
WordPress accumulates post revisions, auto-drafts, trashed posts, and overhead over time. This slows down database queries.
Solution
Clean post revisions, auto-drafts, trashed posts, spam comments, and optimize database tables.
User Stories
Implementation Decisions
Testing Decisions
Out of Scope
Further Notes
Database optimization should work independently of caching.