Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →WordPress automatically permanently deletes eligible posts, pages, attachments, and comments from Trash after 30 days by default. Change that retention period with the EMPTY_TRASH_DAYS constant in wp-config.php; for example, setting it to 7 keeps items for seven days before scheduled deletion.
Set WordPress to empty Trash automatically
The supported setting is EMPTY_TRASH_DAYS, documented in WordPress’s wp-config.php handbook. Add the constant to wp-config.php before the line that says That's all, stop editing! Happy blogging.:
define( 'EMPTY_TRASH_DAYS', 7 );
- Make a backup of
wp-config.phpand your database. - Open the site’s
wp-config.phpfile using your host’s file manager, SFTP, or another authorized method. - Add the
define()line above the stop-editing comment. - Save the file. New items moved to Trash will use the configured retention period.
Replace 7 with the positive number of days you need. If the constant is absent, WordPress uses its documented default of 30 days.
How the retention period works
The period applies to each item’s time in Trash, not to a single site-wide monthly emptying date. An item trashed on Monday becomes eligible after the configured number of days have elapsed for that item. Core’s wp_scheduled_delete() function calculates a cutoff from the current time and permanently deletes trashed comments and posts of any post type that are older than that cutoff. See the function reference.
#1 Best Overall
- Easily store and access 2TB to content on the go with the Seagate Portable Drive, a USB external hard drive
- Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop
- To get set up, connect the portable hard drive to a computer for automatic recognition no software required
- This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
- The available storage capacity may vary.
| Setting | What it does | Recovery window |
|---|---|---|
| Constant omitted | Uses WordPress’s documented default. | 30 days |
define( 'EMPTY_TRASH_DAYS', 7 ); |
Permanently deletes eligible Trash items after the threshold. | 7 days per item |
define( 'EMPTY_TRASH_DAYS', 30 ); |
Explicitly keeps the standard documented period. | 30 days per item |
| A positive custom number | Sets the corresponding retention period. | That number of days per item |
Do not use zero unless you want Trash disabled
define( 'EMPTY_TRASH_DAYS', 0 ); does not mean “run the emptying job immediately while preserving Trash.” WordPress treats zero as disabling Trash: deletion is immediate, and users are not shown a confirmation prompt before permanent deletion. The official configuration guidance warns that this removes the recovery buffer, so use a positive value unless your workflow deliberately requires irreversible deletion.
When does Trash start emptying after you change the setting?
The new value governs scheduled cleanup after the configuration is active. It does not create one bulk emptying event at the end of a calendar period. Each item is evaluated against its own time in Trash, and the core scheduled-deletion process removes items that have exceeded the threshold.
Rank #2
- Easily store and access 5TB of content on the go with the Seagate portable drive, a USB external hard Drive
- Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop
- To get set up, connect the portable hard drive to a computer for automatic recognition software required
- This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
- The available storage capacity may vary.
Changing from a longer period to a shorter one can make already-trashed items eligible sooner if they are older than the new cutoff. Those items still depend on the scheduled task running; editing the file alone does not guarantee that deletion occurs at a particular clock time.
If automatic deletion is not happening
Confirm the constant and its location
- Check spelling and capitalization: it must be
EMPTY_TRASH_DAYS. - Ensure the line is in the active site’s
wp-config.php, not a backup, staging, or different installation. - Use a positive integer and make sure there is no second definition elsewhere that creates confusion.
Check WordPress scheduled tasks
Core cleanup relies on scheduled WordPress work. Review the site’s Cron configuration if items remain past the threshold. WordPress documents DISABLE_WP_CRON and alternative Cron arrangements in its advanced wp-config.php guide. These settings are context for investigating missed scheduled work; inspect the actual hosting and Cron setup before changing them.
Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minutePC 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 & 11Rank #3
- Easily store and access 1TB to content on the go with the Seagate Portable Drive, a USB external hard drive.Specific uses: Personal
- Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop. Reformatting may be required for Mac
- To get set up, connect the portable hard drive to a computer for automatic recognition no software required
- This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
- The available storage capacity may vary.
Investigate plugins or custom code
If products or other content disappear at an unexpected frequency, do not assume the core setting is responsible. A WordPress.org support discussion describes isolating a site-specific conflict by testing on staging with other plugins and the theme disabled. Use that approach to identify custom deletion code or a plugin that alters Trash behavior, then re-enable components one at a time.
Choose a safe value for your workflow
Short retention (for example, seven days)
Choose this when editors rarely need recovery and you want Trash to consume less storage. The trade-off is a shorter period to restore an accidental deletion.
Rank #4
- Easily store and access 4TB of content on the go with the Seagate Portable Drive, a USB external hard drive.Specific uses: Personal
- Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop
- To get set up, connect the portable hard drive to a computer for automatic recognition no software required
- This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
- The available storage capacity may vary.
Thirty days
This is WordPress’s documented default and gives a month-long recovery window for each item.
Longer retention
Use a larger positive number when legal review, editorial approval, or infrequent maintenance requires more time. Remember that retained media and other content can continue using storage until deletion occurs.
Best Value
- [Upgraded Version] - This external hard drive features a mirrored logo stripe combined with a striped anti-slip design, and the rounded corners of the casing make it easier to grip. The stripes also have a heat dissipation function, ensuring stable and fast data transfer.
- 【Ultra-thin and quiet】 - The motherboard adopts JMicron 578 noise-free solution, giving you a quiet working environment. Lightweight and portable size designed to fit in your pocket for easy portability.
- 【Ultra-Fast Data Transfers】 - Pairing this external hard drive with JMicron 578 solution USB 3.0 and USB 2.0 interfaces enables blazing-fast data transfer. It boasts theoretical read speeds of up to 125MB/s and write speeds of up to 103MB/s.
- 【Plug and Play】 - With no software to install, just plug it in and the drive is ready to use.The hard disk chip is wrapped with an aluminum anti-interference layer to increase heat dissipation and protect data.
- 【What You Get】 - 1 x Portable Hard Drive, 1 x USB 3.0 Cable, 1 x User Manual, Gift-type shell packaging ,Three-year manufacturer's warranty and free technical support services.
Immediate deletion
Use zero only when your process accepts that deleted content cannot be recovered through Trash and that WordPress will not ask for a deletion confirmation.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.What this setting covers
The handbook describes the constant as applying to posts, pages, attachments, and comments. The scheduled-deletion function handles comments and posts of any type that have remained in Trash beyond the configured number of days. A plugin may implement additional storage or deletion rules, so verify its documentation when behavior differs from core WordPress.
Quick Recap
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.

