多语言WordPress站点恢复页面后,如何移除Permalink中的__trashed后缀?
Hey there, let's get that messy __trashed-6 suffix removed from your English homepage's permalink. I've troubleshot this exact scenario a handful of times for multilingual WordPress sites, so here are the step-by-step fixes to try:
1. Edit the Page's Permalink Directly
- Head to your WordPress Dashboard → Pages, then locate the restored English homepage.
- Click "Edit" to open the page editor. On the right-hand sidebar, find the Permalink section.
- Click the "Edit" button next to the current URL. Delete the
__trashed-6portion, leaving the path you want (e.g.,en/if it's your root English homepage, oren/homedepending on your site structure). - Hit "OK" and then click Update to save the page.
2. Verify Your Multilingual Plugin Settings
Since this is a multilingual site, your plugin (like WPML, Polylang, or TranslatePress) might be managing homepage URLs:
- Open your multilingual plugin's settings page.
- Navigate to the section that maps pages to languages. Confirm that the restored page is correctly set as the English homepage.
- Some plugins require you to re-assign the homepage after restoring it from the trash, which will auto-correct the permalink to match your site's language structure.
3. Flush WordPress Rewrite Rules (Critical Step)
Even after editing the permalink, WordPress might still cache the old URL. Fix this by:
- Going to Dashboard → Settings → Permalinks.
- You don't need to change any settings here—just click the Save Changes button.
- This flushes the rewrite rules, ensuring your new, clean permalink is recognized site-wide.
4. Manual Database Correction (Only if Above Steps Fail)
If the suffix won't budge, you can tweak the database directly (always back up your database first!):
- Access your site's database via phpMyAdmin (most hosting providers offer this in their control panel).
- Locate the posts table (usually named
wp_posts, but your prefix might beo3zone_instead ofwp_). - Search for the restored English homepage's entry. Look for the
post_namecolumn—this is where the permalink slug is stored. - Edit the
post_namevalue to remove the__trashed-6suffix, then save the change. - Go back to your WordPress dashboard and flush the rewrite rules again (step 3) to apply the change.
Just a quick reminder: Always back up your site before making changes to permalinks or the database, especially on a live multilingual site.
内容的提问来源于stack exchange,提问作者Ndy

