WordPress page slug keeps getting modified and generates duplicate content

I’m dealing with a strange WordPress issue that I haven’t encountered before. I have a page that’s been using the same URL slug for years, let’s say it’s called “services” at mysite.com/services.

This page has worked perfectly with the /services slug for about 5 years without any problems. But recently when I tried to edit this page, something weird happened. I went to mysite.com/services and clicked edit, but then I noticed the permalink had automatically changed to /services-2 and WordPress wouldn’t allow me to change it back to the original.

When I saved the page with the /services-2 slug, all the related subpages and media files got reassigned to this new URL. But here’s the really strange part - when I visited the original mysite.com/services URL, it still worked but now showed a completely different page with a new post ID that was created at the exact same time I saved the /services-2 version.

I managed to reproduce this behavior with another page called “contact”. This time instead of keeping the /contact-2 slug, I tried fixing it by going to permalink settings and switching from post name to default, then back to post name. But this just made things worse - now the original /contact page has a new post ID and all the original content moved to /contact-2.

I’m running WordPress 4.9.4 with all plugins updated. Has anyone seen this kind of slug duplication issue before?

This issue often points to a problem with the database itself. It seems that WordPress believes your slug is already in use due to orphaned entries or previous drafts that didn’t get removed. I experienced something similar and fixing it involved checking the database directly. Backup your database first, then inspect the wp_posts table in phpMyAdmin for any entries with your original slug, particularly those marked as ‘trash’ or ‘auto-draft’. Removing these can resolve the matter. It worked for me, and your case sounds alike.

yup, I’ve had this kinda thing happen too. it might be a plugin messing with slugs, or even some theme settings. just ensure you back things up before tinkering too much. gl!

Had the same nightmare last year with my portfolio site. Turned out to be a corrupted revision system creating phantom entries. I fixed it by deactivating all plugins first, then checking if the problem was still there. An SEO plugin was messing with WordPress’s slug handling. Once I found the bad plugin, I manually cleaned the wp_posts table and reset slugs through the database. Look for entries with post_status set to ‘inherit’ or ‘revision’ - they were blocking my original slug. Also check your .htaccess file for custom rewrite rules that might conflict.