How to Limit or Disable Automatic Empty Trash in WordPress Video

Do you want to change how often your trash is emptied on your WordPress website, or stop WordPress from emptying the trash automatically?

By default, WordPress will automatically delete anything that has been in the trash for 30 days. However, some users might like the trash to be emptied more or less often, or prefer to empty the trash manually.

In this video, we will show you how to limit or disable the trash being automatically emptied in WordPress.

0:00 Intro
0:34 Method 1: Using a plugin
1:31 Method 2: Editing code
3:05 Method 3: Stop auto-empty

Related Links
►Don’t forget to read and subscribe!
►Code from Method 2,Method%202%3A%20Changing%20when%20WordPress%20Trash%20Is%20Emptied%20with%20Code,-You%20can%20also
►Code from Method 3,Method%203%3A%20Stopping%20WordPress%20from%20Automatically%20Emptying%20Trash,-Do%20you%20want
►Change Empty Trash Time

Top Resources

⚡Use Promo Code WPBVIP⚡

►Best WordPress Contact Form Plugin
►Best WordPress Analytics Plugin
►Best Lead Generation Plugin
►Best WordPress SEO Plugin
►Best Theme Builder for WordPress

Related Videos
►WordPress Tutorial – How to Make a WordPress Website for Beginners
►WordPress Gutenberg Tutorial: How to Easily Work With the Block Editor
►What is SEO and How Does it Work?
►How to Install a WordPress Theme

If you liked this video, then please Like and consider subscribing to our channel for more WordPress videos.

Follow us on Twitter:

Check out our website for more WordPress Tutorials

#WPBeginner #WordPress #WordPressTutorial

Do you want to change how often your Trash is emptied on your WordPress Website or if you want to stop WordPress From emptying the trash automatically Then in this video we'll show you how to Limit or disable the trash being Automatically emptied in WordPress and I'll show you a few different methods so You can pick the one that works best for You By default your WordPress website will Automatically delete anything in the Trash after 30 days so it doesn't pile Up but what if you don't want to do that I know some people actually use the Trash as their sorting place or a place Where they keep a lot of posts that They'll reuse and so this is perfect for Them and maybe you as well The first method we're going to use is By using a plug-in so from your Dashboard let's head over to plugins add New And we're searching for a plugin called Change empty trash time This is one we're looking for so let's Go ahead and click install now And then we'll stick around to activate It as well Once it's installed we need to head over To our settings general area and this is Where we can make some changes If you scroll all the way down then now You have an area called time to empty

Trash in days you can do zero in order To remove them directly or immediately But you can also make this to delete After say one day you'll put one seven For weekly 30 for monthly we'll just go Weekly And then we'll click save changes so now That will change and remove anything in The trash after seven days If you don't want to do a plug-in you Can use the code snippet to do this if You're not very comfortable with adding Code then maybe you just want to stick With method one but for this method you Want to edit your WP config file if You're comfortable using an FTP client Then you can do it like that for this One I'll show you how you can go to your Hosting provider and open up your Wpconfig file Go to Advanced and scrolling down we Want to go to file manager from here you See all of these items that we can Choose from and we want to go into Public Scrolling down we're looking for WP Dash Config.bhp We can right click on this and edit And it says hey you know you're going to Edit something and we do recommend that You make a backup Anytime you're making any changes and This is all of the stuff that kind of Runs the back end of your database and

What we want to do is we want to add This bit of code somewhere near the That's all stop editing happy publishing We want to maybe just come up here and We're going to paste this bit of code This bit of code you can find in our Written tutorial you can find a link in The description below to do that so this Is saying empty the trash every one day If you want to change that you can Change that here So we'll just do like we did the other One and just say every seven days make Sure you save your changes and now That'll be done just by using code Now if you want to stop WordPress from Automatically deleting items from the Trash all together then the next method Is for you So with this method we'll also be adding A snippet of code but the best way that We can add this is by using a plugin Called WP code this is perfect if you're Wanting to add little bits of code to Your website and it often can replace Several smaller plugins out there go Ahead over to plugins add new And we'll search for WP code And this is the one we want so let's go Ahead and click install now And activate the plugin Great now that it's activated we see it Down here we can go to code Snippets but If you ever need to come back and make

Any changes then over on the left we Have code Snippets area We can hover over it and let's go to add Snippet and what's really cool about This is these are all available Snippets For you so if you want to add your Custom code which is what we'll do we Can do that if you want to remove or Change the howdy admin and if you take a Look at the most popular these are some Of the most popular ones that you can Enable on your site like if you want to Upload SVG files by default WordPress Doesn't do that if you want to Completely disable comments so there's An easy way to do it here disable Automatic updates so many items that you Can do that will quickly make changes And allow you to customize the back end Of your website and the front end as Well but for this one we want to add Custom codes we're going to say use Snippet and now we want to add a title So you know what this is about And then you want to paste this bit of Code again the written tutorial will Have this information for you and you See that they're getting a little bit of Errors that's simply because we don't Have the right O type so if we scroll Down to page p and now it's all good to Go and what this is saying is remove the Schedule delete so that it doesn't Delete anything for you

Scrolling down this is where you want to Where do you want to insert this because This is for the whole site we want to Auto insert and we want it to run Everywhere and then we want to come up Here to make it active and save snippet And now if you ever send something to The trash then it will stay there until You manually delete it permanently And if you want to see a few more things That WP code can do for you then you can Watch this video next as we walk you Through step by step on how to add Custom code to your WordPress site and I'll see you over there

You might like