Skip Navigation

[Closed] Change URL structure

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.

This topic contains 1 reply, has 2 voices.

Last updated by Nigel 3 months, 4 weeks ago.

Author
Posts
#2745627

Hello,

I have custom post type and custom taxonomy for that CPT. My url is now domain.com/cpt-slug/post-slug

I need to change URL to domain.com/cpt-slug/custom-taxonomy-slug/post-slug

Can you help how to do that?

#2745638

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi there

Such a permalink structure isn't possible with the normal settings available when registering a post type (whether you register the post type using Toolset, or directly using the WordPress function register_post_type).

For structure you would need to set up custom rewrite rules. That involves using add_rewrite_rule to register the custom rules, and using the filter post_type_link to modify the post URLs.

See

https://developer.wordpress.org/reference/hooks/post_type_link/
https://developer.wordpress.org/reference/functions/add_rewrite_rule/

If you Google, you'll find there are lots of tutorials about creating custom rewrite rules.

The topic ‘[Closed] Change URL structure’ is closed to new replies.