When you register the custom post type, you have to specify that the rewrite rule shouldn’t be prepended with the existing URL structure.
In short, this means that this line in your register_post_type
call:
'rewrite' => array('slug' => 'projects'),
should turn into this:
'rewrite' => array('slug' => 'projects','with_front' => false),
For more info, check out the rewrite
argument from the codex entry on register_post_type
edit: just make sure that, after updating the code, you flush the rewrite rules by visiting Settings > Permalinks. Otherwise you’ll still see the old links.
Related Posts:
- Mixing custom post type and taxonomy rewrite structures?
- How to rewrite URI of custom post type?
- How to remove slug from hierarchical custom types in 3.5.2
- Custom post types – Use post_id in permalink structure
- Custom Post Type and Taxonomy URL rewrite
- Custom post type permalink: only use %post_id% and remove %postname%
- Rewrite custom post type rss feed links
- Is it possible to change the URL of custom post types to hide the post type slug?
- Archive page with multiple taxonomies rewrite
- rewrite get parameter with custom post type
- Taxonomy page returns 404 page not found
- Remove unwanted part of permalink custom structure from CPT url?
- How to have a custom URL structure for a custom post type?
- Display CPT taxonomies as an archive page
- Including two taxonomies in a permalink structure
- WP Rewrite Rules – Custom post type & taxonomy
- Changing a custom post type “has_archive” after registered
- URL Design for Sub-Posts?
- Remove base slug in CPT & CT, use CT in permalink
- How do I list terms of a custom taxonomy at i.e. domain.com/brands/
- Permalink Structure problem with cpt and custom taxonomy
- Custom Taxonomy 404
- Custom Post Type rewrite redirects to homepage
- Custom Post Type slug same as page name causing a conflict
- single-{post_type}.php is not loaded despite flushing rules
- Adding paged query to custom URL rewrite
- Custom Post Type rewrite rules not working, how to alter the rewrite order?
- Custom Permalink for Taxonimie and Custom Post Type
- Rewrite Custom Post Type URL slug
- Rewrite numeric ID parameter for hierarchical custom post type
- Customising rewrite rules for CPT single post URL to work as paged URL
- Remove custom post type slug not working for child pages
- Custom WP TItle from custom template with dynamic URL structure
- Rewrite rules for custom post type slug
- In WordPress how do you create a custom post type with the author’s name in the slug?
- Change URL of posts and also Custom Post Type
- Custom Post Type rewrite
- How can I display an archive of only one category of my custom post type?
- Permalink Structure CPT With Custom Taxonomy Fails
- Conditionally custom post type url rewrite
- Making a custom help center page
- Remove url rewrites for registered taxonomies
- Get Taxonomy Term Title by it’s URL
- Can’t get custom rewrite tag, query var, permastruct (permalink structure), and rewrite rule to work properly together
- How to create custom url structure based on custom post type rewrite slug, taxonomy and category slug?
- WordPress custom post type permalink rewrite shows page not found
- Using taxonomy term in CPT permalink – Pages 404’s
- Customize Custom Post Type URL
- Programmatically rewriting slug through functions.php but returns 404
- Custom Permalinks with CPT and Hierarchical Taxonomies
- Why isn’t my custom post type archive URL translating?
- Custom Post Type and Category Base Rewrite Issue
- Rewrite URL of Custom Post Type for Jobs
- Post Type rewrite rule to point to custom Page/template
- Custom Permalink Structure for Custom Post Type, Custom Taxonomy, Under a page
- Ignoring slug capitalization on rewrite rule for custom post type archive page
- Taxonomy in URL
- Custom permalink with child taxonomy terms
- Custom post type archive with page as parent url
- Pagination custom post type not working with rewrite slug
- Postname on unique permalink structure appends “-2” for a custom post type. How can I get this to stop happening?
- After creating Custom post type by user delete old one
- Set parent for custom post type archive rewrite url
- How do I know if a rewritten rule was applied?
- URL Rewrite – Page Archive
- How Can I Remove Custom Post Type Slug From URL
- WordPress custom permalink and archive link for custom post type
- get_post_permalink() and custom permalink rewriting
- Urls in Custom Post Type work for Terms but not for its Taxonomies
- Custom Post Types and Removing Slugs – should we do it?
- Taxonomy rewrite pagination 404
- custom post archive URL is wrong
- WordPress is ignoring my post rewrite rule
- Remove cpt slug from url and use custom taxonomy instead breaks all other cpt
- Custom Permalink For Custom Post Type – Working Fine But Broken For Pagination
- Duplicate content problems after adding an archive page to the article’s post type
- How to properly set the rewrite rules for this case?
- How to fix 404 on post after prepending Custom Post Type url with Custom Taxonomy Term slug
- Redirect Custom Post Type from Child Taxonomies
- Custom post type structure + permalink structure
- Rewrite URL of Specific Post of Custom Type
- Using get_post_type with a custom URL format?
- Custom post type rewrite and wp_pagenavi interfering with each other
- Show index and not the archive for “Dog Custom Post” with default slug
- Custom Post Type rewrite url to /category/pagetitle [duplicate]
- Paging not working for hierarchical custom post type
- redirect old post type url to new structure url
- Custom Post Type URL Rewriting
- Why is a custom post type’s URL “/?cposts=name-of-the-post” but default post’s URL is “/?p=ID”?
- Customize category URL
- Custom Post Type Rewrite Rule
- rewrite rules add a folder in the path
- How can you preserve URLs when moving posts to a custom post type?
- Custom Post Type Base URL
- Custom Taxonomy in Permalink from post type
- Custom Post Type and single-posttype template
- How to rewrite custom slugs that follow my rules
- Custom post type with custom taxonomies structure url not working archive of CPT
- What is the best way to relate different custom post types?
- Allow child pages with the same base as the CPT slug