Create new URL structure for custom post types

Sorted in the end. As Milo suggested I didn’t need the calls to add_rewrite_tag. The following code works: /** * Custom rewrite rules */ function my_rewrite_rules() { add_rewrite_rule( ‘^([^/]*)/([^/]*)/([^/]*)?’, ‘index.php?post_type=room&room=$matches[3]’, ‘top’ ); add_rewrite_rule( ‘^([^/]*)/([^/]*)?’, ‘index.php?post_type=house_type&house_type=$matches[2]’, ‘top’ ); add_rewrite_rule( ‘^([^/]*)/?’, ‘index.php?post_type=development&development=$matches[1]’, ‘top’ ); } add_action( ‘init’, ‘my_rewrite_rules’ );

how to change the title of tag page?

You can use the get_the_archive_title filter, such as: add_filter(‘get_the_archive_title’, function($title) { if(is_tag()) { /* logic to set $title to what you want */ } return $title; }); Take a look at get_the_archive_title() reference for more information on how to use this filter.