The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.
WordPress controls automatic trash emptying with the EMPTY_TRASH_DAYS constant in wp-config.php. It keeps deleted posts, pages, attachments and comments for 30 days by default. Set a positive number for a different recovery window, or set it to 0 to remove the Trash step and delete items permanently immediately.
Choose the behavior you actually want
The setting is a site-wide WordPress core control for the documented content types. Pick the value based on whether recovery or immediate cleanup matters more:
| # | Preview | Product | Price | |
|---|---|---|---|---|
| 1 |
|
TIDTALEO Nordic Style Press Type Trash Can with Lid, PP Household Bin | $21.09 | Buy on Amazon |
| Value | Recovery window | What happens | Main trade-off |
|---|---|---|---|
30 (default) |
30 days | Items move to Trash and eligible items are permanently deleted after the retention period. | Provides a standard safety window while allowing routine cleanup. |
Any positive integer, such as 7 or 90 |
The number of days you specify | WordPress uses that many days before permanent deletion. | Longer retention improves recovery chances but leaves more discarded data to clean up. |
0 |
None | The Trash workflow is disabled. WordPress presents permanent deletion instead, without a confirmation prompt. | A mistaken deletion is immediately irreversible unless you have an independent backup. |
A large positive value is still a time limit, not an archive. WordPress does not promise indefinite retention or recovery after the item is permanently deleted.
Free tools Windows power users keep installed
One-click scans. No signup required.
Change the automatic deletion period
1. Back up the site and identify the correct configuration file
Make a current database and file backup before editing production configuration. Use a staging copy first when possible. Open the wp-config.php file for the WordPress installation you intend to change; it is normally in the site’s document root, although some installations place it one directory above the WordPress files.
#1 Best Overall
- Trash can for toilet--can help make your home cleaner and tidier, practical household garbage can,home garbage can bathroom
- Wastepaper basket--made with premium pp material, and long serving time, practical and convenient,waste basket bathroom
- Bathroom waste basket with lid--the material is pp, strong and , fall resistant, creative and practical,trash basket
- Bathroom trash can --stable and not easy to fall, bring , beautiful and comfortable experience to life,small bathroom trash can
- Waste bin--fine workmanship, polished smooth, no parts, good hand feeling,bathroom trash can
2. Add the constant before WordPress finishes loading
Place the definition with the other WordPress constants, before the line that says WordPress has finished editing the file (commonly the “That’s all, stop editing” comment). Define it only once:
define( 'EMPTY_TRASH_DAYS', 7 ); // permanently delete after 7 days
Replace 7 with the number of days you need. Examples:
define( 'EMPTY_TRASH_DAYS', 90 ); // permanently delete after 90 days
define( 'EMPTY_TRASH_DAYS', 0 ); // disable Trash; permanent deletion is immediate
Save the file and check the WordPress admin for the expected Trash or permanent-delete behavior. A positive integer changes the retention period; it does not turn WordPress into a backup or archival system.
Disable WordPress Trash entirely
To remove the Trash workflow, use:
define( 'EMPTY_TRASH_DAYS', 0 );
With zero, WordPress does not ask for confirmation when someone selects “Delete Permanently.” This is appropriate only when every administrator understands that a click can remove content immediately and another recovery method exists.
How WordPress uses the value
WordPress core defines EMPTY_TRASH_DAYS as 30 when the constant has not already been defined. Its scheduled deletion process calculates a cutoff by subtracting the configured number of days from the current time, then permanently deletes eligible posts or comments in the Trash. The documented scope includes posts, pages, attachments and comments.
The value therefore controls retention in the core Trash system; it does not guarantee that every plugin-created record follows the same lifecycle.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Why trashed content may disappear sooner
If an item vanishes before the configured interval, do not assume the constant is being ignored. Check these boundaries:
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware match- Plugins or custom code: A plugin, theme, or custom function may delete records independently of WordPress core.
- Hosting automation: A host-level cleanup job, deployment script, or scheduled task may remove data outside the normal Trash routine.
- Custom post types and applications: WooCommerce products and other custom post types can have application-specific deletion behavior. Follow that product’s documentation before treating the core setting as the only mechanism.
- Configuration location or duplication: Confirm that you edited the active site’s
wp-config.phpand that the constant is not defined elsewhere in a way that makes your change ineffective.
The official core behavior does not identify one universal cause or provide a complete diagnostic procedure for third-party cleanup. If the timing is unexpected, review plugin settings and code, hosting jobs and application-specific documentation, then test on staging.
Recovery and operational safeguards
For a longer recovery window
- Choose a positive value such as
30,60or90according to your editorial and compliance needs. - Tell administrators how long deleted content remains recoverable so they do not mistake Trash for permanent storage.
- Monitor storage and database maintenance separately; retaining Trash longer can increase the amount of discarded data awaiting cleanup.
For immediate permanent deletion
- Confirm that independent, tested backups exist and that you know how to restore the relevant database and files.
- Restrict deletion permissions to people who understand the no-confirmation behavior.
- Use staging to verify workflows before setting zero on a live site.
When restoring is the only option
After an item has been permanently deleted, the Trash setting cannot bring it back. Recovery depends on an independent backup or another copy maintained by your hosting, deployment or application systems. Verify restoration procedures before relying on a zero-day configuration.
Quick Recap
Quick decision guide
- Need a normal safety net? Leave the constant undefined and use WordPress’s documented 30-day default.
- Need more or less time to recover mistakes? Define a positive integer matching the required number of days.
- Need deletion to bypass Trash? Define
EMPTY_TRASH_DAYSas0, after confirming tested backups and administrator controls. - Seeing earlier deletion despite a positive value? Investigate plugins, custom code, hosting automation and custom post-type rules rather than changing the constant repeatedly.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

