Skip Navigation

[Resolved] Need some help to get URL structure as /category/post-title

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 3 replies, has 2 voices.

Last updated by Waqar 10 months, 2 weeks ago.

Assisted by: Waqar.

Author
Posts
#2669721

I am struggeling in getting the URL for a new CPT "Projects" to be domain.com/categories/post-title.
It stays at domain.com/custom-post-type/post-title, I can't even get it to /custom-post-type/category/post-title which I managed on another website, except I need to drop custom-post-type from the url here to avoid having to create too many url redirects for existing pages.

- CPT option URL rewrite is checked and uses the normal WP logic
- checked and unchecked "Allow permalinks to be prepended with front base", doesn't make a difference.
- have set permalink to "/%category%/%postname%/", doesn't make a difference. Set it even to "/test/%category%/%postname%/", again, no difference.

#2669903

Hi,

Thank you for contacting us and I'd be happy to assist.

To achieve a permalink structure like this for your custom post type, you'll either have to use a third-party plugin or add custom code for the custom rewrite rule.

Here are some useful resources on the topic:

https://wordpress.org/plugins/custom-post-type-permalinks/
https://wordpress.stackexchange.com/questions/39500/how-to-create-a-permalink-structure-with-custom-taxonomies-and-custom-post-types

regards,
Waqar

#2669931

would an url like domain.com/custom-post-type/category/post-title work without the extra code/plugin?

#2670587

Thanks for writing back.

I've performed some testing and research and can confirm that you'll need to include custom code or a third-party plugin to add a category/taxonomy term slug in the URL of the custom post types.

Note: It is possible to set the '/%category%/%postname%/' custom structure through WP Admin -> Settings -> Permalinks, but that is applied only to the regular posts, not the custom post types.

#2670605

Thank you.
Too bad this is not an option in Toolset, where granular URL control is much needed.

kristofG confirmed that the issue was resolved on 2023-12-04 08:02:07.
This ticket is now closed. If you're a Toolset client and need related help, please open a new support ticket.