I have multiple posts with the same title, e.g.
but WordPress doesn’t allow duplicate slugs, so they appear like:
When I managed to allow duplicate slugs, all of these posts loaded on the same page at the same time. The post cities/new-york is about New York City, and the post /states/new-york is about New York State (these are just examples). Obviously none of these posts share categories.
It seems my problem is largely with redirect_canonical(), which will redirect /cities/new-york/ to /states/new-york/, though the second step is failing me. A 301 redirect plugin will not suffice, as /cities/new-york/ also belongs to /big-cities/new-york/ and /us-cities/new-york/ and there are at least 60 of these posts.
Read more here: Stop redirecting to posts not in a category / duplicate slugs