Simple way: In my plugins, register_activation_hook
always have a line like delete_option('rewrite_rules');
when I’m creating custom post types. WordPress will properly rebuild them.
I’ve provided a detailed answer
Also another inspiring answer here
Related Posts:
- Custom Post Type Permalink / Rewrite not working immediately
- WordPress Rewrite Rules for Custom Post Type and Taxonomy
- Permalink rewrite 404 conflict- WordPress Taxonomies/ CPT
- How to modify URL structures in custom post types and taxonomies or terms
- Archive page with multiple taxonomies rewrite
- Help with a TV series Rewrite structure
- Taxonomy archives based on Custom Post Type
- WordPress Custom Post Type Category Page
- Permalink rewrite with custom post type and custom taxonomy
- How to check if last uri segment is a custom post type or taxonomy term?
- WP Rewrite Rules – Custom post type & taxonomy
- Need help with complex custom post type setup
- Remove base slug in CPT & CT, use CT in permalink
- Custom Permalink Tag breaks Pagination
- Custom Permalink for Taxonimie and Custom Post Type
- how to get archive urls with same origin for custom types and terms?
- Adding the taxonomy before the custom post type
- Add hierarchical taxonomy to permalink for custom post type
- How to rewrite custom post type with custom taxonomy urls?
- Permalink Structure CPT With Custom Taxonomy Fails
- Parent & Child Taxonomy slugs in custom post permalink
- Remove url rewrites for registered taxonomies
- Customize Custom Post Type URL
- How do I change the custom taxonomy slug to be the same as the custom post type slug?
- Custom taxonomy rewrite with query var returns %2F in URL
- WP Rewrite Rule Issue while using Custom post type & taxonomy
- Custom Permalinks with CPT and Hierarchical Taxonomies
- How to get list of taxonomy slugs ordered parents>childs?
- Permalink structure with custom taxonomies and custom post type like /parent-tax/child-tax/custom-post-type-name (with no base name)
- Get url.com/post_type/taxonomy/term work!
- Different rewrite rules for taxonomies and cp in multisite?
- How to add custom taxonomy in custom post type permalink?
- SEO Concerns With Rewrite Rules
- How to rewrite custom taxonomy term archive to use THE SAME SLUG/front as CPT
- WordPress custom permalink and archive link for custom post type
- How to rewrite the post slug of a custom post type post
- Modifying rewrite rules to use /category//
- WordPress custom taxonomy page
- rewrite rules hierarchical
- Custom taxonomy and post type rewrite rules
- Remove cpt slug from url and use custom taxonomy instead breaks all other cpt
- How to properly set the rewrite rules for this case?
- Change CPT permalink to use the category
- How to fix 404 on post after prepending Custom Post Type url with Custom Taxonomy Term slug
- Redirect Custom Post Type from Child Taxonomies
- How to build overlapping custom post_type and taxonomy rewrites without conflicts?
- Custom taxonomy archive slug overwrites static page
- Template hierarchy changes when custom post-type permalink leverages custom taxonomy
- Group based routing and administration
- Adding Custom Taxonomy Along-with Post Name in Post Type Permalink
- Associate custom CPT with another CPT’s taxonomy and rewrite permalinks
- Custom Post Type rewrite url to /category/pagetitle [duplicate]
- page not found for example.com/custom-post-name
- Rewrite for custom type and custom taxonomy
- redirect old post type url to new structure url
- Why won’t this rewrite rule work?
- Parent cpt/child custom post type URL permalink relationship
- Adding rewrite rules to Custom Post-type mixed with Taxonomy
- Custom Taxonomy in Permalink from post type
- 404 Error On Custom Taxonomy Pages 2, 3, etc
- Url rewrite with custom post type and taxonomy
- Same slug for Custom Taxonomy archive and CPT archive – Rewrite rule not working
- Two Permalinks with one Taxonomy (custom taxonomy) and (custom post type -> custom taxonomy)
- Exclude a category from WP_Query
- How do I Filter Custom Post Type by Custom Taxonomy in the newest WordPress RESTful API?
- How to list all categories and tags in a page?
- WordPress custom taxonomy URL rewrite on spelling errors
- TV Show database – Best way for structuring it?
- Many to Many Taxonomies or rewrite rules?
- Query posts by custom post type and custom taxonomy
- How to display the rest of categories on Portfolio filterable
- removing custom tax & CPT slug, adding taxonomy term in front of custom type
- Display Posts in Custom Post Types Timber
- Getting a PHP Notice when using Pods with WPML [closed]
- Extending AZIndex plugin to use custom post types and custom taxonomies
- How to display custom taxonomies with links in filter menu?
- What’s the WP way to load remaining custom posts?
- Hide or disallow default custom post type url?
- Best structure / rewrite rules to achieve the following url
- Custom post type Permalinks with hierarchical Taxonomies
- CPT Taxonomy As Archive Page – Error 404
- List all Custom Post Type posts excluding certain Taxnomy term
- Can’t pull posts of a Custom Post Type based on the custom taxonomy of the CPT
- Conditional Statements
- Making a form for user to add new custom post with custom taxonomies and custom fields
- Get newest created custom category (get_term_by and variables) (outside Loop)
- Custom Taxonomy Taxonomies of Same Name point to first created URL
- Taxonomy terms with the same name are updated between separate custom post types
- Custom taxonomy permalink without term, redirection to CPT slug
- Display post count for a specific month
- Add other all taxonomies as meta boxes to custom post type
- URL with Hierarchical Taxonomies and same slug for all terms and sub-terms
- order taxonomy alphabetical
- Custom post type archive page not showing on archive-posttype.php
- Display Custom taxonomy, Child terms and posts in a template Under Specific Parent terms
- Custom Post Types and rewrite rules – One CPT works and a cloned one doesn’t
- List all posts from custom post type by taxonomy
- Sort a custom post type loop by a custom taxomomy instead of chronologically
- Add custom taxonomies as class names to an archive page of custom post types
- Custom Post Type Base URL