Title: Add custom permalink prefix
Last modified: January 21, 2022

---

# Add custom permalink prefix

 *  Resolved [Chris](https://wordpress.org/support/users/osiak/)
 * (@osiak)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/add-custom-permalink-prefix/)
 * Hello,
    is it possible to add a custom prefix to the CPT permalink structure?
   My CPT name is eg. `books` so my default permalink for posts would be `mysite.
   com/books/post-name`. However my CPT in terms of the page navigation is under
   a higher/parent menu, eg. `Products`. So I’d like to have a permalink for each
   of my `books` post as `mysite.com/products/books/post-name`. I tried adding `/
   products/` in the `Custom Rewrite Slug` setting which makes the post permalink
   as I want, but when opening the post the page returns a 404 page. Tried flushing
   permalink structure, but didn’t help. Any way to achieve that?

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Contributor [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [4 years, 4 months ago](https://wordpress.org/support/topic/add-custom-permalink-prefix/#post-15278276)
 * I’m curious if something like [https://wordpress.stackexchange.com/questions/53298/custom-post-type-url-rewriting](https://wordpress.stackexchange.com/questions/53298/custom-post-type-url-rewriting)
   would help out.
 * We don’t have anything specific for settings inside CPTUI for this, as it’s more
   custom permalink creation than is possible with just `register_post_type` itself,
   outside of the slug/”with front” parts that are part of that function’s arguments.
 * Hope this helps
 *  Thread Starter [Chris](https://wordpress.org/support/users/osiak/)
 * (@osiak)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/add-custom-permalink-prefix/#post-15279043)
 * My bad. I have put `/products/books/` in the customer rewrite slug field instead
   of `products/books`. When removing the slashes at the beginning and end it works
   well.
 * However, now I’m getting 404 errors on any regular page that has a parent of `
   products`, eg. `mysite.com/products/bicycles`.
    -  This reply was modified 4 years, 4 months ago by [Chris](https://wordpress.org/support/users/osiak/).
 *  Plugin Contributor [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [4 years, 4 months ago](https://wordpress.org/support/topic/add-custom-permalink-prefix/#post-15284846)
 * Not sure the exact cause of that last part, other than just assuming that the
   mixing of all these parts is making WordPress not sure what it’s supposed to 
   be querying for exactly. I’m curious if the insertion of “products” on your “
   books” post types is now making it think that “bicycles” is either its own post
   type or something else. Seeing as, if I’m reading everything correctly, you have
   a PAGE named “products”, and are also inserting “/products/” before the BOOKS
   post type.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Add custom permalink prefix’ is closed to new replies.

 * ![](https://ps.w.org/custom-post-type-ui/assets/icon-256x256.png?rev=2744389)
 * [Custom Post Type UI](https://wordpress.org/plugins/custom-post-type-ui/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/custom-post-type-ui/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/custom-post-type-ui/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-post-type-ui/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-post-type-ui/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-post-type-ui/reviews/)

## Tags

 * [permalink](https://wordpress.org/support/topic-tag/permalink/)
 * [prefix](https://wordpress.org/support/topic-tag/prefix/)

 * 3 replies
 * 2 participants
 * Last reply from: [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * Last activity: [4 years, 4 months ago](https://wordpress.org/support/topic/add-custom-permalink-prefix/#post-15284846)
 * Status: resolved