Make WordPress permanently delete trashed posts, pages and comments after 7 days instead of 30.
define( 'EMPTY_TRASH_DAYS', 7 );
WordPress keeps trashed posts, pages, products and comments for 30 days before deleting them for good. On sites that trash a lot, such as WooCommerce stores cleaning up draft orders, that’s a lot of dead data. This constant shortens the wait.
EMPTY_TRASH_DAYS sets how many days items stay in the trash. WordPress’s daily wp_scheduled_delete task permanently removes anything older.
Go to Tools → Site Health → Info → WordPress Constants. EMPTY_TRASH_DAYS should show 7.
This website uses cookies to make it work and to understand how it is used. Some cookies are strictly necessary for the site to function and cannot be switched off. Others help us analyse how visitors use the site using our self-hosted analytics tools.
We use Plausible Analytics, which sets no cookies and collects no personal data. We also use Matomo Analytics, which sets cookies only if you choose to accept them. Both tools run entirely on our own servers and no data is shared with any third party. We do not use advertising or social media cookies.
If you are under 16 years old, please make sure you have your parent or guardian's permission before accepting any non-essential cookies.
You can accept all cookies, decline non-essential cookies, or adjust your preferences at any time by clicking Cookie Settings in the footer of this site. For full details on every cookie we use, read our Cookie Policy. For information on how we handle your data, read our Privacy Policy.
Declining analytics cookies will not affect your ability to use this site.
Some required resources have been blocked, which can affect third-party services and may cause the site to not function properly.
This website uses cookies to enhance your browsing experience and ensure the site functions properly. By continuing to use this site, you acknowledge and accept our use of cookies.