How to remove -2 amended to wordpress url

Can someonew please tell me how to get rid of the -2 extension in the wordpress url?
I had two pages - I think one was copied from the other and after deleting one of
them I have this pesky -2 added to the end of the url which won’t go away.

Any help appreciated.

Could you please explain what you are referring to? You have not given us anything to look at here.

Sorry about that :grin:
http://temp.osborneparkautorepairs.com.au/car-air-conditioning-2/

I’m pretty sure this is a result of having two duplicate posts, but deleting one and emptying trash doesn’t remove the ‘-2’ from the remaining post.

Once a post is saved under a certain name in the database, that name won’t change automatically when you delete the duplicate post. You deleted the first one and kept the second one. Hence the -2.

Try going to the edit area for that post. At the top the permalink will be displayed. You can edit that permalink to remove the -2.

Unfortunately changing the permalink does not work. Can it be changed in the database?

Can you change the slug?

If the deleted one is how you want the second to be you;ll probably need to change that to something else first.

Yes it can be changed in the database. But I wouldn’t recommend it unless you really know what you are doing and you are extremely careful. And you need to make sure you backup your database first.

Try all the other options first such as what @Mittineague said.

OK Thanks for your help guys.

To change the URL, go to the page you want to change. Make sure you are in the in the edit screen, not the view screen. Below the page name you will see:

Permalink:http://temp.osborneparkautorepairs.com.au/something-2/

After the address, it will say EDIT. Click edit and it will let you define the extension. In your case you will delete the -2. Then click save.

Yes, thanks, but that was the first thing I tried.

When you deleted the duplicate page, did you remove it permanently from the trash? Sometimes if it’s still in the trash, it registers as in the system. Delete it from the trash, then change the permalink. Also, if you happen to have an image named the same as your extension, it will register as a permalink. Rename the image file.

2 Likes

Paul, Thanks, I finally got rid of the -2 :rage:

  • Deleted the image entirely
  • Deleted the page
  • Deleted the page permanently from trash
  • Recreated the page
  • Didn’t need to touch the permalink (as yet)
    Mind you, I did all of the above previously with no result.
    Fingers crossed the pesky -2 doesn’t sneak back into the URL.

Thanks guys for your help.

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.