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.
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.
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.
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:
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.
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.