I had to face a similar issue a while ago and got it resolved by following this guide.
Basically what you have to do is two functions 1) Custom WordPress Rewrite Rule and 2) Custom Post Type Link.
The Rewrite Rule function will make sure the custom slug for your CPT is handled properly throughout the site. And the second function will ensure that it displays the URL the way you want – you can also include taxonomy variables if you wish to. Anyway take a look at the article as it helped me a lot and I hope it helps you too as well.
Related Posts:
- Remove slug from custom post type post URLs
- Add .html (dot HTML) extension to custom post types
- Possible to change the URL for the regular post type without affecting the URL of other custom post types?
- How to give a CPT (custom post type) a date based url
- URL for custom post type
- Custom Post Type Archive URL takes over page URL
- WordPress Custom Post Type Category Page
- How to Add Pages Under Custom Post Type URL Structure?
- Best Way to Leverage Custom Post Type Related Content and Consider SEO
- How to have a custom URL structure for a custom post type?
- Pagination throws 404
- Creating multiple page URL without creating the pages in WordPress
- WordPress custom post type url change
- remove post-name from title in custom post type
- Rewrite Custom Post Type URL slug
- CPT posts listed by category with custom rewrite URL, please help!
- How do I get the permalink structure to work like this?
- URI returns a post when it should return a 404
- Query string parameters from custom fields, inconsistent results
- Query var removed after rewrite
- Bizarre Permalinks Issue: 404 Errors Everywhere
- How to detect filter in URL in Category page?
- Custom Post type and permalink settings
- Custom Post Types, URL rewrite on multiple CPTs
- Get Taxonomy Term Title by it’s URL
- can I chage url for register_post_type
- How to add a post slug to a url?
- URLs for child terms
- Remove the parent slug in a CPT URL
- create a subcatagory for a custom post type and out put url as posttype/subcategory/item
- Rewrite Question Mark in Post Template to Make it Pretty URL
- Changing the search url according to language
- WordPress randomly shows 404 errors
- non-hierarchical post type with hierarchical url structure
- Taxonomy in URL
- Best structure / rewrite rules to achieve the following url
- CPT category hierarchy
- Create Custom Post Type as page
- retrieve permalinks of posts inside custom post type by using post ID
- How does: /index.php?post_type=event&event-date=2011-07-25 work? What if it doesn’t work?
- How to create connection among state, city, store and store number based on URL
- custom endpoints on Custom Post Type return 404 page not found
- Custom Post Type Category URL
- Sanitize title only if only custom post type
- link featured image to external link
- How to display wp_post by custom field value?
- Custom post type URL
- How to add page under a custom post type?
- Changing custom post type URL issue
- Custom Post Type URL Rewrite’s
- Post/Custom Post Type URL Access
- Custom post type items open in archives?
- returning the currect URL for nested posts
- how to achieve this permalink abc.com/CPTName/CustomPostTypeCategorySlug/categoryname
- I want to rewrite the URL of a specific post with a specific custom field to easily analyze in Google Analytics
- Preview url not working outside wp-admin
- URL for archive of custom post type with 2 taxonomy terms
- Subpages URLs for Custom Post Type
- Query custom post type and custom field by URL parameters
- Add %post_id% to slug of custom post type and prevent the “unique slug” thing that WP does?
- Turning archive templates to a page template maintaining the slug
- CPT – Custom Text fields point to new url permalinks
- How to display a custom post as a page (but unedited)?
- How to manage a custom post type archive as a page?
- How to manage a custom post type archive as a page?
- Unwanted URL with Custom Post Type
- Custom Post – additional param in the custom post URL goes to error page
- Single Post (CPT) in two pages – Normal and Extended
- Remove wp directory and slug for custom post type from the URLs
- What am I doing wrong with my taxonomy?
- Do not output category and tag URLs
- Force WordPress to only match URL in category
- Custom post type clean url
- Custom post type with parent page? Possible?
- Get full control over custom post type url
- Custom url for custom post types
- Stop Custom post type from being searched via URL
- Why is a custom post type’s URL “/?cposts=name-of-the-post” but default post’s URL is “/?p=ID”?
- Custom Post Type Categories Not Maintaining URL structure any more
- remove custom post type ulr
- Category slug not showing for Custom Post Type
- Customize category URL
- Remove custom taxonomy ‘post-type’ from post URL
- Cannot get query var ‘post_type’ to work
- Why are my wp urls showing page not found?
- Sorting custom post types by taxonomy (So close)
- Removing custom post type name in single article URLs
- create gallery page for specific post id
- Tags and Taxonomy links not working for Custom Post Types
- Creating additional page with own URL for each custom post
- img src not working correctly in custom post type
- Links in archive not including taxonomy parameter
- Menu Structure and URL structure, with Pages and Post-Type-Posts
- Custom Post Type with multiple Custom Taxonomies / Hide Taxonomy Slug from URL
- Hide custom post type slug url from search engine [closed]
- Custom post type with custom taxonomies structure url not working archive of CPT
- Is it possible to use a post name in a custom post slug?
- Rewrite rule taxonomy url with different values in one function
- Change post-name when inserting new Post if Specific Category is selected in WP
- How do I get parameters from the URL?