Sorry guys, this is becoming a habit, but I found a solution, as follows:
set rewrite to false in taxonomy registration:
register_taxonomy(‘property_type’,array(‘sbproperty’), array(
‘hierarchical’ => true,
‘labels’ => $labels,
‘show_ui’ => true,
‘query_var’ => true,
‘rewrite’ => false
));
And create my own rule
add_filter('rewrite_rules_array','wp_insertMyRewriteRules');
add_filter('init','flushRules');
function flushRules(){
global $wp_rewrite;
$wp_rewrite->flush_rules();
}
function wp_insertMyRewriteRules($rules)
{
$newrules = array();
$newrules["([a-z]+)-in-turkey-for-sale/?$"] 'index.php?property_type=$matches[1]-in-turkey-for-sale';
return $newrules + $rules;
}
Related Posts:
- 404 error- issues with pages after adding custom rules for posts
- Hierarchical taxonomies in permalink cause 404 for sub term archive
- custom taxonomy and pages rewrite slug conflict gives 404
- Remove taxonomy base or term from url
- Removing taxonomy base using WP rewrite
- Custom taxonomy on permalink
- Custom Taxonomy Leads to 404 Page – Permalink Structure Flushed
- Custom taxonomies, with custom rewrites/slug, AND loading a taxonomy archive template from a plugin
- URL rewrite rules for multiple taxonomies query
- Rewrite rule for custom taxonomy
- Nice URLs for a Custom Post Type List with a Shared Custom Taxonomy?
- How to pass posts_per_page and paged params query vars to custom taxonomy archive urls?
- How do I rewrite a url to use %taxonomy% instead of %category% when multiple taxonomies are present?
- Pros and cons of using [taxonomy name] in place of [category name]?
- WP redirects pretty permalink to query string
- Removing the base “Author” or changing it to something else. is it possible?
- Permalinks for quote authors
- Custom Taxonomy 404
- Sorting Posts Via Custom Taxonomy Values Using Checkboxes?
- Add parent/child taxonomy to custom post type url
- Keep taxonomy base name in post permalinks
- Category page for custom-taxonomy shows 404 when using custom permalink structure
- Permalinks for custom taxonomy stopped to work
- Taxonomy with_front causes all
- How to overwrite registered taxonomy url from vendor plugin in child theme
- Custom taxonomy in URL showing 404
- How Can I Change a Taxonomy URL Based On The Originating URL?
- How to add a Rewrite Rule / Category Structure
- Rewrite URL for taxonomy listing
- Custom permalinks with hierarchical taxonomy – getting PHP warning
- Change the permalink URL to include a taxonomy term
- Rewrite Rule Working for all but one of the taxonomies created
- Page and Post return 404 with custom taxonomy
- Custom post URL 404 error
- How to Rewrite Taxonomy URL to Include the Post Type as the Second Segment of the URL?
- Taxonomy Pagination Rewrite
- woocommerce custom product category template
- Add Taxonomy Subcategory To Permalink
- how to change permalinks format for pagination?
- Custom Taxonomy and Rewrite URL
- How do I create a permalink structure with 2 taxonomies
- Rewrite Rules returning wrong data
- Pagination on Custom Tax Pages Removes Spaces from Query Vars
- How to rename custom taxonomy URL with extra words
- Custom URLs in Custom Search Results
- How to change url for taxonomy pages?
- Query custom taxonomy by term id?
- Custom Taxonomy specific to a Custom Post type – rewrite URL
- How to add hierarchical taxonomy with parent child relation to URL?
- Clean Custom URL for Serach + Custom Taxonomy
- Custom rewrite permalink doesn’t work
- forward/redirect taxonomy archive of term to a page with same name
- URL rewriting taxonomy term
- How can i fix a 404 error when targeting custom taxonomy slug ?
- Permalink issues with custom taxonomies
- 404 Error on Custom Post Type / Custom Taxonomy
- Custom taxonomy throw error 404
- Taxonomy URL rewrite whilst keeping filtered posts?
- Rewrite Search URL Permalink For CPT Custom Taxonomies
- How can I rewrite the URL of my custom taxonomy to include the year?
- How to change Custom Permalink for Taxonomy? (remove the slashes from term-slug)
- How do I get the correct URL?
- How to structure all custom-taxonomy with three verbs(a,b,c) and route them accordingly?
- problem : Custom taxonomy template not showing
- Rewriting url for multiple Taxonomies and Custom Post Type
- Custom rewrite url structure for several custom taxonomy (NOT pos_type)
- How to pass posts_per_page and paged params query vars to custom taxonomy archive urls?
- Remove taxonomy name and add .html extension in the custom taxonomy term URL
- How to paginate with an query var appended to permalink?
- Permalinks incorrectly inserting multiple categories
- Custom Taxonomy Archives Page Errors
- Permalink structure not working with Custom Taxonomy (URL like ./taxonomy/category/postname)
- Error 404 in Custom taxonomy with pagination
- add_rewrite_rule using custom taxonomy and year
- Need help understanding a rewrite with multi-level taxonomy
- Broken paths on taxonomies after changing permalink to post name
- Custom taxonomy rewrite in permalinks for posts gives 404 on pages
- Taxonomy to WordPress Permalinks of custom post type
- Multiple Taxonomy in URL/Query – No Custom Post Type
- Creating a page for custom taxonomy archive
- Custom Taxonomy Archive URL rewrite
- Later change of taxonomy slug base not changing permalink
- Rewrite URL for a specific taxonomy [duplicate]
- Edit tags page for hierarchical taxonomy doesn’t show taxonomies at all depths
- I want to load post content by categories using Ajax
- WP_insert_term how to insert multiple values as taxonomny term?
- Improving WP_Query performance for multiple taxonomies
- Create Child Taxonomies
- Custom Post Type rewrite rules not working, how to alter the rewrite order?
- Can I use a Custom Meta Value inside of ‘get_the_terms’?
- add hirarchy of categories in products grid of visual composer
- Returning One custom taxonomy term name
- Load a certain functions file for a certain taxonomy
- How do I get the labels from a post
- Displaying user selected custom tags/taxonomies on the front-end
- Wp_insert_term doesn’t work from separate file with custom taxonomy
- Query by multiple custom taxonomies
- get the custom taxonomy name?
- Templates files for custom post type with custom tags
- Hide empty categories on widget