softmaji-header-wbg-min
softmaji-header-wbg-min
softmaji-blue-header-min
softmaji-blue-header-min
  • Home
  • Services
    • Website Designing
      • Responsive Website Design
      • Static Website Design
      • Website Redesign
      • Landing Page Design
    • Website Development
      • PHP Website Development
      • WordPress Website Development
      • Ecommerce Website Development
      • Custom Website Development
    • Digital Marketing
      • Google Adwords/PPC
      • Facebook Promotion
    • SEO Service
  • Trainings
    • Learn Web Development
    • Learn Graphics Design
    • Learn Business Communication Skills
  • Pricing
  • Portfolio
  • Events
  • Offers
  • Contact Us

How To Automatically Delete Trash In WordPress?

HomeHow To Automatically Delete Trash In WordPress?

Offer Expire Soon..


Only New User..


At times, there are a huge number of posts in Trash and you might want to delete all of them at once. In WordPress, the ‘wp-config.php’ function controls the time frame for which the data is stored in the WordPress trash folder. By editing the time frame in the ‘wp-config.php’ function you can reduce the number of days for which the data is stored in the trash folder. If you do this, there will be no need to check the trash folder for deleting the posts.

Here are the necessary steps for editing the time frame for wp-config.php function:

WordPress sets a default time frame of 30 days for the data to be retained in the trash folder. If you check the wp-config.php file, you will come across the following:

define( ‘EMPTY_TRASH_DAYS’, 30 ); // 30 days default

You will have to change the time frame mentioned above. For instance, if you would like the WordPress system to delete the trash posts in 10 days, you can edit the entry mentioned above:

/* Automatically delete WordPress trash after 10 days */

define( ‘EMPTY_TRASH_DAYS’, 10 );

Related: How To Fix Leverage Browser Caching In WordPress Website.

In the example given above, if you define the number of days to 0, WordPress posts will stop accumulating in the trash folder. This is not recommended as there is a chance that you might lose some of the important posts. Therefore, it is advisable to set the number of days less than 30 but not 0.

Faizan Khan
19
Latest News
Prev PostHow To Resolve The ‘INTERNAL SERVER ERROR’ In WordPressMay 14, 2024
Next PostHow to Manage Users in WordPress?May 14, 2024

Related items

otpless-issue
Latest News

OTPLess Not Working? Here’s What Happened!

Imagine this: You run a business, and suddenly, your customers can’t log in to your websit

SoftMaji InfoTech
20/06/2025
7
Latest News

How To Install WordPress Blog?

Let’s see how to install WordPress blog on your WordPress hosting account. Let’s

Faizan Khan
14/05/2024
149
Latest News

How to Install a Theme in WordPress?

Steps to install a theme in WordPress: Log in to WordPress. Navigate to Appearance and cli

Faizan Khan
14/05/2024
135
softmaji-header-wbg-min
SoftMaji is one of the affordable web development company in the web development industry. You don’t have to go searching anywhere for finding a reliable web development partner because we have crafted web development solutions that can fill the void left by others in the market.
Services
  • News Portal Development
  • Custom Website Development
  • PHP Website Development
  • Ecommerce Website Development
  • WordPress Website Development
Shortlinks
  • Blog
  • Offers
  • Events
  • Pricing
  • Reviews
  • Portfolio
  • Our Team
  • Payment Options
  • Explore Packages
Company
  • FAQ
  • Careers
  • Sitemap
  • Feedback
  • About Us
  • Contact Us
  • Privacy Policy
  • Terms & Conditions
  • Refund And Cancellation
Contact Us
4/40 Vipul Khand , Gomti Nagar Lucknow
Uttar Pradesh 226010
Landline - +915223162418
Email - hello@softmaji.in
Office Time Mon - Sat
(10:00AM - 5:00PM)
Sunday Close
+91 9795405324
Lucknow , Uttar Pradesh
Copyright © 2022. All Rights Reserved.