__trashed 6: Understanding and Fixing WordPress Permalink Issues
Encountering "__trashed 6" in your WordPress page URLs? You\'re not alone. This issue, where "__trashed" appears in the permalink (URL) of your posts or pages, can be frustrating. It often happens after a page has been trashed and then restored, or sometimes even when editing drafts. This guide explains what causes this problem and how to fix it.
What Causes the "__trashed" Permalink Issue?
WordPress uses the \'add_trashed_suffix_to_trashed_posts\' PHP filter to prevent URL conflicts. When a post or page is moved to the trash, WordPress may add a suffix like "__trashed" to its slug (the part of the URL after your domain name). This ensures that if you create a new page with the same name as the trashed one, there won\'t be a URL collision. The problem arises when you restore a page from the trash. In some cases, the "__trashed" suffix, like “__trashed-2/”, isn\'t automatically removed, leaving you with an undesirable URL.
Hi sleepiergirl, I was able to reproduce this issue at my end. Here’s what I did. 1. I create a page and Named it “our team” 2. Then I created another page “Testslug” and A Wordpress site of mine seems to have changed some of my pages permalinks by adding __trashed after the slug. Note that not all pages are affected, neither do other post types. Slug text remains “__trashed” after restoring. I tested this using the same steps I outlined in wordpress-mobile/WordPress-iOS (comment), with the same results. Am I experiencing a similar issue? It\'s crucial to understand that this can affect parent-child relationships. After I made my site go live, I realized that one of the page url’s carried the words “__trashed-2/” on the end. It is a child page under a drop down menu and does not function correctly.
Filters whether or not to add a __trashed suffix to trashed posts that match the name of the updated post. It is designed to prevent conflicts, but sometimes it introduces new problems.
How to Fix the "__trashed" Permalink Issue
The most common and straightforward "solution" for now is to manually remove “__trashed” from the permalink of the posts that get it. That’s not optimal for obvious reasons. WordPress and our team recommends following these steps:
- Log in to your WordPress admin panel.
- Navigate to the affected page or post. Go to Pages (or Posts) and find the page with "__trashed" in its URL.
- Edit the page or post.
- Locate the Permalink. It\'s usually located just below the page title or in the right sidebar. You might need to click the "Edit" button next to the current permalink.
- Remove "__trashed" from the slug. Delete the "__trashed" (and any numbers following it, like "__trashed-2") from the URL slug.
- Update the page or post. Click the "Update" button to save the changes.
Editing a draft page the URL follows the renaming of the post title. Once the page, or post, is published make sure to check the permalink!
Possible Conflicts and Redirects
Be aware of potential conflicts. If you have a redirect in place, it might interact unexpectedly with the "__trashed" suffix. There is created a redirect from /software/ to /yoast-seo-platforms/ which works correctly. However, if there is a live page in the deleted section, \'trashed\' is added to the slug, potentially breaking the redirect. Always test thoroughly after making changes.
If You\'re Still Seeing "__trashed 2"
Si te encuentras con el problema de que tu página web muestra un mensaje de error «__trashed 2» y no está disponible, no te preocupes, ¡aquí te presento una solución: The manual fix outlined above is the primary solution. If the issue persists, consider clearing your browser cache and WordPress cache (if you\'re using a caching plugin). If that doesn\'t work, temporarily deactivate your plugins one by one to see if a plugin conflict is causing the problem.