A Common Permalink Duplication Problem

Written by on January 24, 2011 in WordPress Tutorials - 8 Comments

I’m launching a health related website within the next few weeks. The site is powered by WordPress and styled using the Headway framework.

I’m hiring a few bloggers for the blog section of the website but a lot of focus will be on 5 or 6 resourceful articles which explain the disease and how people can live with it etc. I created the pages whilst designing the site and asked the writer to simply update them when she has finished the articles. Unfortunately, instead of updating the appropriate pages correctly she created 6 new pages. As such, I had to delete my original pages.

Today when reviewing her submission I noticed that the URL’s for the pages had a 2 at the end i.e. www.website.com/example-page-2 instead of www.website.com/example-page. This is a problem which can occur when using %postname% in your permalink structure.

It occurs when two pages have the same article name; forcing the second page created to have a 2 added to the end of the permalink (or 3 or 4 etc for 3rd and 4th copies). WordPress would not allow me to remove the number 2 from the end of the permalink with it appearing back when I deleted it. This confused me for quite a while as I had deleted my original pages and all that remained were the new pages which my writer added. Eventually I figured out why this was occurring.

When a post is moved to the trash it is not removed from the database. Instead, it is moved to the trash page, where the article can be restored or deleted forever. In order to fix the permalink duplication problem you need to ensure that the duplicate page is deleted from the trash page forever. I’m sure that most of you will probably have to deal with this problem though it’s a handy thing to remember if you are deleting duplicate pages.

Hope you found this useful :)

Kevin

About

Kevin Muldoon is a Scottish webmaster and blogger who currently lives in Bogota, Colombia. He has an unhealthy obsession with trying out new WordPress themes and plugins and spends too much time in the WordPress Forums.

Post comment as twitter logo facebook logo
Sort: Newest | Oldest

Yup, had this one before too. Although it can be irritating, it's probably a good thing. I've deleted stuff before that I thought I'd never ever want again, only to prove myself horribly wrong.
You say you're using Headway. Any specific reason for that?

Hi Johm,

It's a great framework once you understand it. It makes building mini sites a breeze. It has really improved over the last year or so.

Kevin

@Amy - You're more than welcome :)

@Natalie - Glad you found the article useful :)

@Pippin - I'm glad I'm not the only one who struggled with this!

Timely post -- I just experienced this over the weekend and I tabled it for researching the solution. Thanks!

I've definitely run into this issue quite a few times. It took me awhile before I figured out the fix.

I'm sure this will be useful for all those still struggling with this.

Thank you!

I had this issue when I first started out with my blog in September. I ended up renaming stuff instead of having a '2' at the end. The fix you have shared kinda seems like common sense now I look back, but oh, I wish I had realised!

Thanks once again - more tips like these please!

Natalie