4.1 slug issue when same title exists in media library
-
This version of WordPress does not tolerate the page slug being the same as the title of an existing image, and will change the page slug without warning when you update the page.
I just spent a couple of hours trying to resolve this. After upgrading my website to 4.1, I went to edit an existing page to add a few paragraphs of new content. The article (page) slug was, let’s say, “example-page”. When I saved the modified version of the article, WordPress changed the slug to “example-page-2” – without warning. This caused all sorts of problems –
- The old slug was used in the url and was already indexed in Google. So now my visitors were about to land on a 404 not found page.
- I immediately lost my google+ votes and facebook likes.
- WordPress would not allow me to change the slug back to what it was by any means (I tried changing the slug itself both on the page and via quick-edit, I tried restoring the article content to a previous revision – nothing worked).
I had to restore the website from a backup (which I took before upgrading, phew). Then I tested everything on a test copy of my website. The conflict was between the article (page) slug, and the titles of several images I had in my media folder. This version of WordPress does not tolerate the page slug being the same as the title of an existing image, and will change the page slug without warning when you update the page.
Having restored from backup on my live site, I re-updated WordPress to 4.1, then changed the image titles so that they were all different from my page slug, then … SUCCESS! I was able to update my page without the slug being changed by WordPress.
This particular article (page) has not been updated since August 2014, so I don’t know whether this issue was introduced in an earlier version of WordPress.
However, it’s a real trap for the unwary. My request is that in future releases, WordPress displays a warning when it is about to change an existing slug and should tell the user where the conflict is occurring and suggest what the user can do.
Thanks everyone for your great work in developing WordPress and providing excellent support on this forum.
Regards,
janaa
- The topic ‘4.1 slug issue when same title exists in media library’ is closed to new replies.