On my WordPress site, I have this URL format:


When I create a new post and select a parent category and a sub-category and select sub-category to default then WordPress builds a URL that looks like this:


This URL and the top URL:


are both working correctly and both show that one post.

The problem starts when Google says one of them is a duplicate post.

Now I want to redirect this URL


to this url


for all posts on the entire site and for future posts.

1 Answer 1


Personal Feeling about Categories in Paths

Personally, I stopped going crazy about categories and actually even removed them completely from my websites. They not only don't help because people don't search those lists (my hits on those lists has always been dismal) but as you can see it creates duplicates. So I deleted all my categories.

As a result my URLs are just:


And everything works like a charm.

If you expect a really large number of posts (thousands) on your website, though, having top-level categories may still be a good idea. For small sites, it's just a big waste in all sorts of ways.

Oh and as a result of removing the categories on my websites, it looks like I gained in rank since I get more traction. Not a lot more, but I still noticed.

Redirect—to answer your question

I don't know of a plugin to redirect from sub-paths to the main path. Such may exist. Of course, there are plugins you could use to create redirects by hand, but that would be really tedious.

Note that a large number of 301 is not ideal for a website. You'll notice that Google Console reports those as errors (although the new console version does not mark them as errors but warnings. So it may be fine as long as you add a single such 301.)


Another way for Google is to fix the canonicalization of the page. So instead of a redirect, you create a canonical meta tag which includes the path you want, whatever the sub-categories. I'm not too sure how you control that under WordPress. I would suggest you test the various plugins that say they can create/fix your canonical path.

To verify the canonical, look at the resulting page source and make sure that the header meta tag looks correct. It has to be a full URL (i.e. including the protocol, domain name, and path.)

Note that Google still gives you a warning about such pages, saying that it found page blah with canonical foo. This is fine, though.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.