Back to Community

How to Customize Permalinks with Custom Post Type UI and Taxonomy Slugs

52 threads Sep 7, 2025 PluginCustom post type ui

Content

Many WordPress users turn to the Custom Post Type UI plugin to create custom content structures. A frequent goal is to have detailed, SEO-friendly permalinks that include taxonomy terms, such as example.com/services/plumbing/faucet-repair. However, users often discover that achieving this specific URL structure is not a built-in feature of the plugin. This article explains why this happens and outlines the most common solutions available.

The Core Limitation

The Custom Post Type UI plugin is designed for one primary purpose: to reliably register post types and taxonomies in WordPress. It excels at creating the foundation for your custom content. However, it does not handle advanced permalink customization. The plugin's settings allow you to define the base slug for a post type (e.g., services) or a taxonomy (e.g., service_category), but it cannot automatically inject dynamic taxonomy terms into a post's permalink structure.

When you try to use a tag like %taxonomy% in the "Custom Rewrite Slug" field for a post type, it is treated as a literal string. This results in URLs like example.com/services/%service_category%/my-post instead of the desired example.com/services/plumbing/my-post. This is the expected behavior, as transforming those tags into dynamic values requires additional code that falls outside the plugin's scope.

Recommended Solution: Use a Permalink Plugin

The most straightforward method for most users is to employ a dedicated permalink management plugin. These tools are built specifically for complex URL rewriting and often provide a user interface to achieve your desired structure without writing code.

Based on frequent recommendations in the support threads, one of the most popular and effective plugins for this task is Permalink Manager. It allows you to set custom permalink structures that incorporate taxonomy terms, custom fields, and other elements for both posts and taxonomies themselves.

Alternative Solution: Custom Code

For developers comfortable with code, it is possible to modify the permalink structure manually by adding filters to your theme's functions.php file or a custom plugin. This typically involves two main steps:

  1. Modifying the Post Permalink Structure: Using the post_type_link filter to replace any placeholder tags (like %taxonomy_slug%) in the URL with the actual term slug from the post.
  2. Updating Rewrite Rules: Adding new rewrite rules so that WordPress understands how to interpret the new URL pattern and query for the correct post.

This approach requires a good understanding of WordPress's rewrite API and can be fragile if not implemented correctly, especially after permalink flushes. Numerous tutorials on third-party development blogs detail this process, which can be found by searching for terms like "add taxonomy term to custom post permalinks."

Important Considerations and Common Issues

  • Hierarchical Taxonomy Terms: Including multiple levels of a hierarchical taxonomy (e.g., domain.com/country/city/post-name) adds another layer of complexity to the rewrite rules and is often best handled by a dedicated plugin.
  • Taxonomy Archive Links: Changing the post permalink structure does not automatically change the taxonomy term archive URLs. These are controlled by the taxonomy's own rewrite slug setting in CPTUI.
  • The "Exclude from Search" Setting: A crucial note from the threads: if you set a custom post type to "Exclude from Search," WordPress will also remove its posts from taxonomy term archives. The recommended workaround is to leave this setting off and use the pre_get_posts filter to manually exclude the post type from search results.

In summary, while Custom Post Type UI creates the content structure, achieving complex permalinks requires an additional tool. For most users, a permalink manager plugin is the safest and most efficient path to success.

Related Support Threads Support