Does WordPress automatically redirect url without parent slug?

I inherited admin duties for my organization’s site. Ive noticed that if I enter a url with a child slug only (and drop the parent) it seems to redirect to the full url.

Ex: www.example.com/child-page goes to www.example.com/parent-page/child-page

Is this a standard WordPress feature? I’m basically wondering if I can give people the short version and know that it’s reliable. Or should I create an actual redirect for that purpose?

1 Answer
1

Yes, it’s a standard feature. For the most part it is safe to print them so people can type in the shorter URLs. But… if you will ever end up with duplicate slugs, say

www.example.com/about/contact

and

www.example.com/department/hr/contact

(so, both slugs are contact

WordPress can only show 1 page for each slug. So, if you’re ever going to end up with duplicate slugs – whether those are Posts, Pages, or Custom Post Types – or even Attachments – just know that you’ll need to test each link and make sure it’s pointing to the page you want it to.

And as far as digital links, always use the long version, to minimize the number of redirects a browser has to pass through to get to the actual end-result URL.

Leave a Comment