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:
- Custom rewrite rules for archive page and single post
- WordPress Rewrite Rules for Custom Post Type and Taxonomy
- How to pass URL parameters for advanced taxonomy queries with multiple terms for one custom taxonomy
- Add category to custom post URL
- Creating a custom public user page
- How to filter custom post type archive by meta value
- Taxonomy archives based on Custom Post Type
- Slug for custom post type archive
- Change page /2 to /transcript with a Rewrite
- Multiple custom post types using the same taxonomy = URL frustrations
- Permalink rewrite with custom post type and custom taxonomy
- Child pages on hierarchical Custom Post Types 404s
- How would I leverage custom Taxonomies in this scenario?
- WordPress returns 404 on custom rewrite rule conflict in parameters
- Permalinks for CPT breaks permalinks to pages
- WordPress custom post type url change
- Possible to change the slug of default post type?
- Is slug “type” reserved and can’t be used in taxonomy rewrite?
- Custom Post Type get_post_type_archive_link( $post_type ) returns false
- Permalinks when filtering multiple custom post types by single taxonomy
- custom taxonomy archive by year
- How can you handle rewrite rules for custom post types with option to filter on custom taxonomy terms?
- Conditional regex in add_rewrite_rule() for specific query filters & pagination
- Displaying Posts of a Custom Type
- Can’t change first part of URL rewrite for custom post type
- CPT Archive with core Category
- Relative URLs for a particular custom post type?
- Custom Taxonomy URL are redirecting to page with the same name
- How to have custom post type /example/ and then posts /example/posts.html
- Change custom post type slug from plugin options
- How can we take into account post types when constructing permalinks?
- 404 Issue w/ Custom Post Type – using Meta for Permalink rewrite
- Taxonomy custom post type URL
- Custom rewrite url category
- How can achieve this permalink perfectly? domain.com/%category%/%post-name%
- How to add rewrite rule to custom post type with parent in url with cpt ui?
- How do I change the custom taxonomy slug to be the same as the custom post type slug?
- Custom Permalink to remove category word , keeping posts permalink with date?
- WP Rewrite Rule Issue while using Custom post type & taxonomy
- Rewrite custom post type url – Multiple post types
- Rewrites/query for multiple hierarchical custom post types
- WordPress uses url different from defined in rewrite arg of custom post type
- Rewrite rule for Custom Post Type Page as a parent
- add_rewrite_rule and passing variables for custom post types
- Ignoring slug capitalization on rewrite rule for custom post type archive page
- Taxonomy in URL
- Custom URLs in post types make it impossible to view archive
- Custom Permalinks for Custom Post Types
- Postname on unique permalink structure appends “-2” for a custom post type. How can I get this to stop happening?
- Share root slug for Child Page and Custom Post Type (prioritizing child pages over posts)
- Route subpage to Custom Post Type
- Custom Post Type Category URL
- Custom Post Type Advanced Slug
- How do I know if a rewritten rule was applied?
- 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
- Custom Post Types and Removing Slugs – should we do it?
- Pagination for custom post types – url rewriting
- Modifying rewrite rules to use /category//
- Taxonomy rewrite pagination 404
- Custom rewrite rule takes place AFTER the generic category rule
- Adding /blog in front of single posts (only)
- Remove cpt slug from url and use custom taxonomy instead breaks all other cpt
- multiple URLS for the same page
- How to properly set the rewrite rules for this case?
- Define multiple prefixes for custom post type
- How to fix 404 on post after prepending Custom Post Type url with Custom Taxonomy Term slug
- Custom Post Type parent/child relationship rewrite rules for permalinks
- Custom post type structure + permalink structure
- Rewrite URL of Specific Post of Custom Type
- Using get_post_type with a custom URL format?
- Rewrite url post_tag for custom post type
- How to build overlapping custom post_type and taxonomy rewrites without conflicts?
- Show index and not the archive for “Dog Custom Post” with default slug
- Custom Post Type rewrite url to /category/pagetitle [duplicate]
- Remove custom post type slug but keep related category taxonomy permalink
- page not found for example.com/custom-post-name
- Force WordPress to only match URL in category
- Paging not working for hierarchical custom post type
- Custom post type with parent page? Possible?
- Custom Post Type URL Rewriting
- Archive page for a custom post type using WPML
- Why won’t this rewrite rule work?
- Cannot modify a registered custom post type rewrite slug
- Customize category URL
- Custom Post Type Rewrite Rule
- rewrite rules add a folder in the path
- Generating custom URL before post is published
- Custom Taxonomy in Permalink from post type
- Custom post type permalink structure
- How can i change url structure of cpt like this?
- Rewrite Rule for custom post type link with or without taxonomy terms
- Rewrite nested urls for custom post type
- Custom post type Premalinks main page and details page
- Custom post type with custom taxonomies structure url not working archive of CPT
- Rewrite rule taxonomy url with different values in one function
- Remove date rewrite rule for custom post type archive page
- How to make a Custom Post Type entry to have different parent pages
- Display content based on multiple URL parameters—pretty URL or query string