Custom post types can not use the “day/name” permalink structure defined in WordPress permalinks settings. You need to add your own rewrite rules to fit your needs.
For example:
add_action('init','my_rewrite_rules');
function my_rewrite_rules(){
// Replace custom_post_type_slug with the slug of your custom post type
add_rewrite_rule( 'custom_post_type_slug/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/(.+)/?$', 'index.php?custom_post_type_slug='.$matches[4], 'top' );
}
Note that I’ve not tested the code above. You need to flush the rewrite rules before you test it.
Related Posts:
- Custom Post Type Permalink / Rewrite not working immediately
- Best way to flush_rewrite_rules for custom post type, in a mu-plugins plugin?
- Custom rewrite rules for archive page and single post
- WordPress Rewrite Rules for Custom Post Type and Taxonomy
- Custom post type 404s with rewriting even after resetting permalinks
- Multiple post types – share same ReWrite slug?
- Rewrite rule for Custom post type Monthly and Yearly archive
- add_rewrite_endpoint() not working for custom post type archives
- How to modify URL structures in custom post types and taxonomies or terms
- Modify custom post type rewrite rules in a separate function
- Permalinks so that one custom post type appears to be a child of another, not working
- Help with a TV series Rewrite structure
- Taxonomy archives based on Custom Post Type
- Change page /2 to /transcript with a Rewrite
- Using %postname% tag with a Custom Permastruct creates 400 Bad Request Errors from the server
- WordPress Custom Post Type Category Page
- Permalink rewrite with custom post type and custom taxonomy
- Rewrite custom post type url’s adding meta box values
- Permalinks for CPT breaks permalinks to pages
- Priority for Categories, Tags, Taxonomies, Posts, Pages and Custom Posts with same url
- Custom Post Types: pretty search URLs and has_archive
- wrong template for page of archive
- WordPress Rewrite rule for nested post types
- WordPress rewrite my URL when i use pagination
- Add hierarchical taxonomy to permalink for custom post type
- How to Combine Two Custom Post Types into Single Permalink Structure
- How to rewrite custom post type with custom taxonomy urls?
- How much control do we have over CPT rewrite slugs? Can I create a “root” page for my CPT with out the page path, and then have paths for other pages?
- how to add extra GET parameters to post to url with add_rewrite_rule?
- Parent & Child Taxonomy slugs in custom post permalink
- Rewrite slug of custom post type to include post-id
- Display posts from Custom Post Type in category page on front-end
- How to change custom post type permalink structure
- Front custom edit post page for each post
- Rewrite Question Mark in Post Template to Make it Pretty URL
- How can achieve this permalink perfectly? domain.com/%category%/%post-name%
- Custom post type + category archive page
- How do I change the custom taxonomy slug to be the same as the custom post type slug?
- WP Rewrite Rule Issue while using Custom post type & taxonomy
- Rewrites/query for multiple hierarchical custom post types
- CPT Template Not Showing – Getting 404
- How to get list of taxonomy slugs ordered parents>childs?
- remove base slug from hierarchical custom post type
- Rewrite Endpoints and CPTs – How to use in a plugin
- Make custom post types and pages place nice, re: rewrite
- add_rewrite_rule and passing variables for custom post types
- Get url.com/post_type/taxonomy/term work!
- Relationship between set rewrite flag in register_post_type and add_rewrite_rule
- Custom rewrite to fetch feed data
- custom post type archive page has 404 error even though has_archive is true
- Custom Post Type posts, conflict with posts after add_rewrite_rule to top
- Combine multiple CPT names to create valid permalinks
- Custom Post Type – Rewite Archive page
- SEO Concerns With Rewrite Rules
- How to rewrite custom taxonomy term archive to use THE SAME SLUG/front as CPT
- Rewrite permalink for multiple post types (CPT) with taxonomy term
- How to rewrite the post slug of a custom post type post
- rewriterule not working
- Custom Post Type with modified permalink structure results in 404
- Modifying rewrite rules to use /category//
- Custom post types and custom variables — add_rewrite_tag() not working
- Add Custom Values to Permalinks Through Custom Fields and Posts
- Why do I need to register my custom post type a second time when flushing rewrite rules?
- Custom post rewrite rule not working
- Subpages Permalinks Issues
- rewrite rules hierarchical
- Custom Post Type Date Based Archive URL rewrite [duplicate]
- WordPress rewrite rule doesn’t work unless post category is explicitly called in regex
- How to make a post accessible from multiple post type slugs?
- Rewrite URL for CPT to domain/post-name/post-id
- Custom Post Type add_rewrite_rule
- How to apply multiple rewrite_rule to a single custom post type url?
- Custom permalink structure for custom post types including multiple taxonomy
- Sudden 404 pages on product category archives
- CPTs relationship
- Change CPT permalink to use the category
- add_rewrite_rule wordpress ignoring url pattern, wp rewrite not working
- Rewrite url for custom post type with specific url
- Default custom post type url
- How to build overlapping custom post_type and taxonomy rewrites without conflicts?
- Pagination URL in Custom Content Type
- Two CPT: one is using part of the custom rewrite slug from the other
- Custom taxonomy archive slug overwrites static page
- Group based routing and administration
- Adding Custom Taxonomy Along-with Post Name in Post Type Permalink
- Permalinks for a custom post type – with a page template (custom query) and taxonomy archive
- how to use two permalinks for one custom post type based on categories
- WordPress custom post type rewrite rule matches all pages returning 404
- Get the custom post type slug but remove the rewrite prefix?
- Custom Rewrite Tag Structure
- Rewrite rules causing hole
- Parent cpt/child custom post type URL permalink relationship
- Custom post type rewrite with_front
- CPT Template Not Showing – Getting 404
- How to make nested custom post type slugs work
- Rewrite Rule & Regex – Extract ‘cat-name’ and ‘page-number’ from http://domain.com/custom-post-type/category/cat-name/page/page-number
- Permalink of Custom Post Type
- add_rewrite_rule not working in Custom Post Type UI Plugin
- Custom archive URL as a subfolder of the custom post type slug
- Need help creating a WordPress site that has a landing page and sub pages for an area (for example, “London”). Website will have 100’s of areas