Rewrite Permalink Structure To Include Taxonomy Term Slugs For Your Custom Post Type

This download folder includes the entire code for creating a CPT and registering 2 custom taxonomy terms.

In this case, the CPT is named property and the custom taxonomies are district-type and city-type.

The single permalink structure, as seen in the demo video, is :

/property/district/city/single-entry-title/

To customize this code to match your own custom post type and taxonomies, simply search find and replace the names using your code editor.

Here’s what the code generates in your WordPress Dashboard :

CPT Custom Taxonomy Terms

Demo Video #

Shows the CPT taxonomy term slugs for property district and city types added the custom permalink structure on the single entry listing.

Tested using both the AgentPress Pro & Genesis Sample child themes by StudioPress.

Code Installation – From Download Folder #

There’s only 1 step :

Copy & paste all the PHP code to the end of your child themes functions.php file then go to Settings > Permalinks and click Save Changes to flush your old rewrite rules and save the new ones.

Download Folder

Related Code Snippets

Join 5000+ Followers

Get The Latest Free & Premium Tutorials Delivered The Second They’re Published.