Troubleshooting
WordPress Error in Moving the Item to Trash: Causes and How to Fix It

Short answer
This error means WordPress could not update the post's status to trash in the database. The usual causes are invalid zero dates or broken tables after a migration, a plugin blocking the action, or missing user rights. Back up, test with plugins off, then check the posts table and debug log.
Key takeaways
- Nothing is deleted when this error appears; the post keeps its original status.
- Zero dates on imported posts often fail under strict MySQL modes.
- Migrations can drop primary keys and auto-increment on wp_posts and wp_postmeta.
- Plugins can cancel trashing through the pre_trash_post filter.
- The debug log usually names the exact failing query or plugin file.
What does “Error in moving the item to Trash” mean in WordPress?
It means WordPress tried to change the post's status to trash and the database update failed or was blocked, so the post stayed where it was.
You usually see it on a plain white screen after clicking Trash under a post, page or custom post type in the admin list. The message comes from WordPress core, not from your theme.
The good news is that nothing has been deleted. The post is still in its original status, so you can take your time and work through the causes below.
Why does WordPress fail to move a post to the trash?
The most common causes are a database problem, a plugin blocking the action, missing user permissions, or a post that someone else is editing.
Moving a post to the trash is not a delete. WordPress saves the current status in post meta, then updates the post's status to trash with a normal post update. If either step fails, you get the error.
Here are the usual suspects, from most to least common:
| Cause | Typical sign | Quick check |
|---|---|---|
| Invalid dates or broken table after a migration | Error appears on old or imported posts | Look for zero dates in wp_posts |
| Missing primary key or auto-increment | Error started right after moving hosts | Check table structure in phpMyAdmin |
| Plugin blocking the trash action | Only some post types fail | Deactivate plugins one by one |
| User role lacks delete rights | Only some users see it | Test with an administrator account |
| Post is locked by another editor | Message names another user | Wait or take over the post |
| Crashed or full database | Other saves fail too | Run a table repair |
How do you fix it quickly?
Start by trying the action again from a different place, then test with plugins off and check the database if the error stays.
Work through these quick checks first:
- Refresh and retry. Log out, log back in and try again. An expired login session can make admin actions fail.
- Try a different method. Open the post in the editor and use Move to trash from the sidebar, or use the bulk action Move to Trash in the posts list.
- Test another post. If only one post fails, the problem is in that post's data. If every post fails, look at plugins or the database.
- Use an administrator account. If an admin can trash the post, the issue is user permissions.
If none of those work, take a full backup before you change anything. Our guide on backing up the WordPress database covers the safe ways to do that.
Can invalid dates in the database cause this error?
Yes, a post with a zero date like 0000-00-00 00:00:00 can fail to save on MySQL servers running in strict mode, and that failed save stops the trash action.
This is very common on sites that were imported or migrated from an older server. Old installs sometimes stored empty dates as zeros in post_date_gmt or post_modified_gmt. Newer MySQL and MariaDB versions often run with strict SQL modes that reject those values on update.
When WordPress tries to update the post, the database refuses the whole query. WordPress then reports that it could not move the item to the trash.
To check, open phpMyAdmin from your hosting panel and run a query on the posts table (replace the wp_ prefix if yours is different):
SELECT ID, post_title, post_date_gmt
FROM wp_posts
WHERE post_date_gmt = '0000-00-00 00:00:00';
Drafts legitimately have a zero GMT date in many setups, so look mainly at published or imported posts in the results. You can fix a broken post by setting its GMT date to match its local date, or by opening it in the editor, changing the publish date and saving it.
The MySQL manual explains the NO_ZERO_DATE and strict modes if you want the technical details. Your host can also tell you which SQL mode your server uses.
Can a migration break the posts table?
Yes, some migration tools and manual exports drop the primary key or auto-increment setting on WordPress tables, and then updates and new rows start failing.
If the error started right after you moved hosts, check the structure of wp_posts and wp_postmeta in phpMyAdmin. The ID column on wp_posts and the meta_id column on wp_postmeta should be the primary key and set to auto-increment.
When those settings are missing, WordPress can insert rows with an ID of 0. The first one works, then every later one clashes. The trash action writes post meta, so it is often the first thing to break.
Fixing table structure is delicate work. If you are not comfortable editing tables, ask your host to restore the keys, or re-run the migration with a reliable tool. Our guide to fixing broken things after a migration covers other problems to look for at the same time.
How do you repair a crashed database table?
Use the Repair option in phpMyAdmin or turn on the built-in WordPress repair page, then try trashing the post again.
Crashed tables stop all writes, not just the trash action. If saving posts and updating settings also fails, a crashed table is likely.
To use the WordPress repair tool:
- Add
define( 'WP_ALLOW_REPAIR', true );to wp-config.php above the line that says to stop editing. - Visit yoursite.com/wp-admin/maint/repair.php.
- Click Repair Database.
- Remove the line from wp-config.php when you are done, because the page does not need a login.
The full process, including the phpMyAdmin method, is in our guide to fixing database tables that need repair.
A full disk on your hosting account can cause the same symptom. If your host shows you are at or near the storage limit, free up space and try again.
Can a plugin stop posts from going to the trash?
Yes, plugins can hook into the trash process and cancel it, and some plugins break it by accident when they hit a PHP error during the action.
WordPress has a filter called pre_trash_post that lets code stop a post from being trashed. Plugins use it on purpose to protect certain content, such as checkout or account pages in a store, or pages tied to a membership system.
Other plugins run their own code when a post is trashed, such as cleaning up related data. If that code throws an error, the request can fail before WordPress finishes.
To find the plugin:
- Deactivate all plugins from Plugins > Installed Plugins.
- Try to trash the post again.
- If it works, reactivate plugins one at a time and test after each one.
If you cannot reach the dashboard, our guide on deactivating plugins without admin access shows how to do it by renaming folders.
The wider process, including how to test themes as well, is in our plugin conflict guide.
You can also check the plugin's settings. Some page protection or Lock features in SEO, membership and store plugins prevent important pages from being deleted.
Do user permissions affect moving posts to the trash?
Yes, if your role cannot delete that post, WordPress blocks the action, though it normally shows a different “not allowed” message rather than this one.
By default, Authors can trash their own posts but not other people's. Contributors can only delete their own unpublished posts. Editors and Administrators can trash almost anything.
A role editor plugin or custom code may have removed delete rights from your role. Compare your account with the default capabilities in our guide to WordPress user roles, and see the official Roles and Capabilities reference for the full list.
If you see “you cannot move this item to the Trash” with another person's name, that user is still editing the post. Wait for them to finish or open the post and choose Take over.
How do you find the real error with debug mode?
Turn on WordPress debugging and check the debug log right after the trash action fails, because it often names the exact database error or plugin file.
Add these lines to wp-config.php:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
Try to trash the post again, then open wp-content/debug.log. Look for lines starting with WordPress database error or PHP Fatal error from around the same time.
A database error line will usually include the failing UPDATE query and the reason, such as an incorrect datetime value. A fatal error will point to a plugin or theme file. The official debugging documentation explains each constant, and our guide on reading the debug log helps you make sense of the output.
Turn debugging off again when you are finished.
What if you just need the post gone?
You can delete the post permanently with WP-CLI, which skips the trash step, but only do this once you are sure you will not need the post back.
If you have SSH access, run:
wp post delete 123 --force
Replace 123 with the post ID, which you can see in the URL when editing the post. The wp post delete command documentation lists the other options.
Permanent deletion still touches the database, so it can fail for the same reasons. If it does, fix the database problem first.
It is also worth checking that the trash is turned on. If your wp-config.php has EMPTY_TRASH_DAYS set to 0, WordPress skips the trash and deletes posts straight away. You can read more about where trashed items go in our guide to finding the trash in WordPress.
How do you stop this error from coming back?
Keep your database healthy, use a trusted migration method, and update plugins regularly so old code does not break core actions.
A few habits help:
- Back up before migrations and check the posts table structure after each move.
- Fix zero dates on imported content once, rather than post by post.
- Keep PHP, MySQL and plugins up to date, since many trash errors come from old code meeting new servers.
- Ask your host before changing SQL modes yourself, as they may manage it at server level.
If the error persists after all of the above, contact your host with the line from your debug log. A database error message gives them everything they need to help.
Frequently asked questions
Does the error mean my post was deleted?
No. When WordPress shows this error, the update failed, so the post keeps its original status such as published or draft. It will still appear in the normal posts list. Nothing has been moved or removed, so you can fix the cause and try again safely.
Why does the error only happen on old posts?
Older or imported posts often have zero values in their GMT date fields. Many modern database servers run in strict mode and reject updates that keep those values. Fixing the date on the affected posts, or asking your host about the SQL mode, usually solves it.
Can I empty the trash if I cannot add posts to it?
Yes. Emptying the trash deletes posts that are already there, which is a separate action. Your existing trashed items can still be removed from the Trash view in the posts list, though a broken database table may cause that action to fail too.
Will switching themes fix the trash error?
Rarely. The trash action runs in the admin area and is handled by WordPress core and plugins. A theme only causes it if it adds code that runs when posts are trashed. Testing with a default theme is still a reasonable step after you have ruled out plugins.
Is it safe to repair the database myself?
The built-in repair tool and the phpMyAdmin Repair option are generally safe, but always take a full backup first. Changing table structure, such as adding primary keys, is riskier. If you are unsure, ask your hosting support to do it for you.
Sources
- Debugging in WordPress WordPress Developer Resources
- Roles and Capabilities WordPress.org
- Server SQL Modes MySQL
- wp post delete WordPress Developer Resources
- wp_trash_post() WordPress Developer Resources
Is your product missing, or something out of date?
Tell us what to add or correct. We read every note and reply when we need a source. A message does not buy a ranking.
Thanks — we review requests within 3 business days.
Related guides
About the editors
Researched from the primary sources listed above and checked against our editorial rules before publishing.


