2

In my site the blogs resolve as %category%/%postname% for now. However, I want the blog URLs to be /blogs/%postname%. I know I could go to Permalinks and add blogs as a prefix before %postname%. However, I also have custom post types. What this does is add the blogs prefix to the custom post types too. For example, I have a custom post type called whitepapers and all those URLs resolve to whitepapers/%postname% If I change the permalink structure as described above, it becomes blogs/whitepapers/%postname%.

How do I change the URL structure only for the blogs but let the custom post type be as they are?

2
  • 5
    You should just use the Permalink Settings page to set the permalink structure to /blogs/%postname% and for your custom post types, set the with_front argument to false to not include the /blogs/ in the CPT posts' permalink.
    – Sally CJ
    Commented May 18, 2021 at 11:33
  • 1
    @SallyCJ this helped. Thank you. Commented May 18, 2021 at 14:03

1 Answer 1

1

As @sally-cj mentioned in their comment, which is also the solution:

If you have set a custom permalink prefix (for example: /blogs/%postname%/) for your blog posts (which results in: yoursite.com/blogs/lorem-ipsum-dolor), it might also get applied to your custom post types too (resulting in: yoursite.com/blogs/customposttype/dolor-sit-amet). The easiest and most conventional solution is to set the with_front argument to false on the CPTs.

If you are using ACF, you can find this in:
Edit Post Type -> Advanced Settings -> URLs -> Front URL Prefix (set this to false)

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.