I have a wordpress website with a menu structure that has home page as a parent with two sub-menus: privacy & sitemap.
The Permalink for the home page is this:
http://localhost/mysite/mysiteWP/ (as you would expect - since wordpress doesn't display the home page name.)
But for the two sub-menus it shows up as this:
http://localhost/mysite/mysiteWP/home-2/privacy-statement/
http://localhost/mysite/mysiteWP/home-2/site-map/
Why is the home page now listed as home-2 directory? Where can I change it back to be just home?
If I actually put this in the address bar: http://localhost/mysite/mysiteWP/home/site-map/ It resolves to this: http://localhost/mysite/mysiteWP/home-2/site-map/
I don’t think this was the way it worked when I first started this site. However, I accidentally deleted my main menu at some point (I know.. my bad!), and had to re-add the menu. It was after this event that I noticed the home-2 in the URLS. (This probably doesn't have anything to do with the problem, but I wanted to mention it just in case!)
I also read somewhere that if you have a duplicate page name (ie: in draft) that will cause the -2 added to a directory or page name. I did have a duplicate home (draft) page, but I have now trashed it & permanently removed it, AND that still didn't solve my problem.
What is causing it to be home-2, and is there anyway I can change it back to home?
Go to All pages
from Dashboard
and find the parent page of your subpages site-map
and privacy-statement
. It must be named Home
( your front page now ). Then hover on it and click Quick Edit
.
You should saw something like this:
Change the slug
from home-2
to home
( I marked that field with red underline ). And click to Update
button. Your subpages will have permalinks like so now:
http://localhost/mysite/mysiteWP/home/privacy-statement/
http://localhost/mysite/mysiteWP/home/site-map/
Note, that you can't save page with slug home
, if there is another page with same slug
in the Published
, Draft
, Scheduled
categories.