Close Menu
wpexpelorwpexpelor
  • WordPress Beginner tips
  • WordPress Security
  • about us
  • contact us
Facebook X (Twitter) Instagram Pinterest
Facebook X (Twitter) Instagram Pinterest
wpexpelorwpexpelor
  • WordPress Beginner tips
  • WordPress Security
  • about us
  • contact us
wpexpelorwpexpelor
Home»WordPress Beginner tips»WordPress Trash Location
WordPress Beginner tips

WordPress Trash Location

NinaBy NinaDecember 22, 2023Updated:December 22, 2023No Comments4 Mins Read
WordPress Trash Location
WordPress Trash Location
Share
Facebook Twitter LinkedIn Pinterest Email
5/5 - (1 vote)

This article of wpexpelor is about wordpress trash location. You may have come across the question: where the things that we delete on our WordPress website is saved? And whether it is possible to restore deleted items or not? How can I restore deleted post and pages in WordPress? Here, we are going to explain the answer. 

Contents show
1 WordPress trash location for Deleted posts and pages
2 What happens when we delete a post(page) in wordpress?
3 Limit or disable automatic empty trash wordpress
4 Restore deleted wordpress Comments
5 Restore deleted media in wordpress

WordPress trash location for Deleted posts and pages

When you delete a “post” in wordpress, it goes to the trash section. It is easy to access the trash location, just open all posts section from the WordPress dashboard. Then go to the trash tab, and the contents that we have deleted can be found there.

Wordpress trash location for Deleted posts and pages
WordPress trash location for Deleted posts and pages

It is the same with the “pages”. You can find the deleted items by clicking on the all pages section, and there is a trash section there that belongs to the deleted page this time. 

wpexpelor WordPress trash location
wpexpelor WordPress trash location

By clicking on Restore, you can restore the items (whether it is a post or a page)

What happens when we delete a post(page) in wordpress?

When we delete the page/post, the WordPress content management system labels the items as “temporarily deleted”. By this, it informs the database that this item has been deleted and is in the Trash. By default, WordPress content and pages are located in the “wp_posts” table of the database.

As you can see in the image below, there is a column named “post_status” in this table. This column shows the status of each post.

SQL check post status
SQL check post status

Now, we are going to check the trash status through an SQL query. Open the “wp_posts” table and click on SQL to write this query:

SELECT * FROM wp_posts WHERE post_status = 'trash';

This query means showing all the contents that the “post_status” is set on “trash.”Click on the “GO” button to show the result.

wordpress sql result
wordpress sql result

Here is the result:

Limit or disable automatic empty trash wordpress

The WordPress Trash can keep deleted content for 30 days by default, and after 30 days, it deletes everything forever.

Limit or disable automatic empty trash wordpress
Limit or disable automatic empty trash wordpress

You can not restore the content that is permanently deleted unless you have a backup from the website. If you want to limit or disable automatic empty trash wordpress and change the amount of storage in the Trash, you can use the following piece of code:

define('EMPTY_TRASH_DAYS', 7);

Place the code in the “wp-config.php” file.

In the code above, we put the value 7. This means that after 7 days, the Trash will be emptied automatically. As we said, the default value is 30 days so that you can increase or decrease this value according to your needs.

Restore deleted wordpress Comments 

Restoring WordPress comments is the same as the procedure that we explained for deleted posts and pages. Open the comments section from the WordPress dashboard, and then you can restore any comments from the trash section.

Restore deleted wordpress Comments 
Restore deleted wordpress Comments 

The only difference is that the comment table is stored in a different table in the database. In fact, the comments are placed in the “wp_comments” table in the database.

Restore deleted media in wordpress 

WordPress media section does not have a trash section! So when you decide to delete media, make sure! Because it’ll be deleted permanently and can’t be restored. But Is it possible to restore deleted media in wordpress?

As I said, the WordPress content management system doesn’t support such a possibility by default, but you can use plugins to restore images as well. To do so:

Media Trash Button plugin
Media Trash Button plugin
  1. Open the WordPress dashboard and then go to the Plugins section.
  2. Search for “Media Trash Button” and install and activate the plugin.
  3. Open the media section.
Media Trash Button plugin details
Media Trash Button plugin details

As you can see, a notification appears at the top of the page that tells you to copy this piece of code and place it in the “wp-config.php” file.

define('MEDIA_TRASH', true);

Open the file manager via FTP or open your site’s hosting panel, edit the “wp-config.php” file, and add the piece of code to it.

Media Trash Button "wp-config.php" setting.
Media Trash Button “wp-config.php” setting.

By clicking this option, our media will be moved to the Trash.To access the Trash can, click on All media items and select Trash.In this section, you can see and manage your deleted media.

Media-Trash Button plugin result
Media-Trash Button plugin result

I hope this article of wpexpelor about wordpress trash location was handy for you. Comment with any questions below. Best

 

Share. Facebook Twitter Pinterest LinkedIn Tumblr Email Reddit VKontakte Telegram WhatsApp
Previous ArticleChange WordPress Admin Login URL
Next Article How To Turn On xml-rpc In WordPress

Related Posts

woocommerce user registration form without email

June 9, 2024

Edit Author Slug in WordPress

January 30, 2024

install 2 wordpress on same domain

January 23, 2024

Leave A Reply Cancel Reply

Trending
seo

SEO Services in texas

By NinaMay 30, 20250

Do You need to grow your business in Texas? Whether you own a company website or an online shop, you can count on us. We will get in touch as soon as possible. Please fill in the box with your name and email address.

WordPress Show Data From Database

December 12, 2023

woocommerce user registration form without email

June 9, 2024

WordPress database update required loop

April 6, 2024

Edit Author Slug in WordPress

January 30, 2024
Social
  • Facebook
  • Twitter
  • Pinterest
  • Instagram
Facebook X (Twitter) Instagram Pinterest
©2025 WPexpelor. All Rights Reserved.

Type above and press Enter to search. Press Esc to cancel.