This is the normal behaviour of a custom post type. Any post type other than pages and posts has the post type name in the URL. So for this URL:
https://example.com/products/product-name/
“products” is the post type. Not the category. Similarly, when registering a post type, if has_archive
is set to true
, then all Products will be automatically viewable at:
https://example.com/products/
The rewrite
and has_archive
properties can be used to change which slug is used for each for these. For example, if you set:
'has_archive' => 'shop',
'rewrite'. => [
'slug' => 'product',
'with_front' => false,
],
Then the products archive URL will be:
https://example.com/shop/
And the individual products’ URL will be:
https://example.com/product/product-name/
In neither of these cases do you need a “product” or “shop” category.
Related Posts:
- Shouldn’t this be easy?! Custom post type/custom taxonomy permalink
- Combining Multiple Taxonomies in one URL
- Getting the Intersection of Two Custom Taxonomy Terms for a Custom Post Type?
- Why does my custom taxonomy show a total count across all post types
- ‘No pages found’ in Dashboard after registering custom taxonomy
- Custom Post Type with Nested Taxonomy and Template Files
- How to display recent posts added in custom post types
- Should unaltered default loop/query return a list of custom posts belonging to a custom taxonomy?
- 404 error PageNavi custom type taxonomy | wordpress
- Creating a function that receives the taxonomy terms that have been changed in a custom post type
- Query for posts in 2 taxonomies
- Permalinks when filtering multiple custom post types by single taxonomy
- Filter custom post type archive page with custom taxonomies (categories) with AJAX
- custom taxonomy archive by year
- How to get posts from multiple custom post types according to it’s custom taxonomy terms?
- get_template_part for each level of taxonomy term
- Displaying a custom post types custom taxonomy value?
- Podcast Guest List
- custom permalinks based on taxonomies for custom post type
- Update post terms with custom taxonomy
- Deleting Custom Taxonomy Term only increments tag_ID
- Get custom post type list for every category shortcode
- Custom Post Type Taxonomy Filters
- getting all values of a custom taxonomy if there is no post
- Listing tags from a custom post type
- How do I associate a custom post type with another through a taxonomy or storing an ID in a custom field?
- Use same slug base for Custom Post Type posts, and multiple taxonomy terms
- create a subcatagory for a custom post type and out put url as posttype/subcategory/item
- How do I display the taxonomy term alongside the post type post title?
- Get related posts of child term of custom post type
- Filter term taxonomy metabox in custom post type
- Show custom post archive when custom post not specified
- Show custom post type relationships by taxonomy
- Custom Post, set object Taxonomy terms in plugin
- Hierarchy and access control for Custom Post Types (CPT)
- Custom post type / taxonomy rewrite archive page 2 gives 404
- Different Category system needed for the Custom Post Type
- single-{post_type}.php not working
- WordPress wp_query() basic question about args
- Loop through custom posts by taxonomy and display the titles in a list, it is repeating 8 times
- How to add current custom taxonomy slug to body class
- Custom post type, custom taxonomy, query posts only from taxonomy (children of)
- How to define a term for custom taxonomy
- Exclude posts with custom taxonomy
- List custom taxonomy as navigation – taxonomy pages with all it’s posts?
- Get parent category(taxonomy) ID from single template of a custom post type
- Dynamic CPT / Taxonomy
- How to approach a site where it has sub-businesses, each with its own pages (“articles”, “staff”)? Don’t want to use WP multisite
- Get the link of the first post of a custom taxonomy in a custom taxonomy list
- Get custom term meta problem on single post type
- Creating custom post type posts and associating them with a post from another custom post type
- Different structure/content for posts from a custom post type
- Custom Post Type View Button in Admin Gives 400 Error
- Custom Post Type URL Rewrite’s
- Add term for custom taxonomy from front end
- Custom Taxonomy Filter Issues
- how to organize my categories or should I do custom post types for some?
- How do i display post from a taxonomy term?
- Multiple permalinks for a single post with multiple taxonomies
- rewrite rules hierarchical
- either single-{custom}.php 404’s OR /taxonomy/ 404’s – custom post type and taxonomy permalinks
- How do I make a request in my browser to search the CPT taxonomy?
- Archive page of taxonomy returns a 404 error
- Get dropdown child categories from parent category of custom post type
- How do you create pillar content pages?
- How to display “META” array in register_taxonomy
- If ACF Post Object post has custom taxonomy term…
- I want to create a metabox under custom taxonomy
- Grid slider with custom post type (how to filter with taxonomies?)
- Customise Permalink Structure For Custom Post Types
- How to filter taxonomy of a custom post type and display it in the single post type page in the back end?
- CPT/Taxonomy/Postname permalink structure makes pagination break
- Set different posts_per_page for custom post type/taxonomy
- Custom Taxonomy not working front side Woocommerce
- Custom post type post_type_link gives “page not found” on any other custom post type
- Facing some Issues on Two Parts Custom Post Type Taxonomy Names
- I want to create an archive and single page for a custom taxonomy for a custom post type
- Taxonomy’s title
- Display all posts from single taxonomy term
- Creating adminable dynamic filtering on custom post type
- Best way to use Category & Custom Fields?
- Complex strcuture as CPT or taxonomy for use in woocommerce product variations [closed]
- WP_Query for CPT with filter by another WP_Query
- Get posts in same category not working
- Heirarchical URLs with CPT and custom taxonomy
- Displaying taxonomies with manage_{custom-post-type}_posts_custom_column
- Plugin Error on activating
- Permalinks when using Custom Post Type with static page for archive
- How to change permalinks to taxonomy and post type’s posts
- Paginate custom taxonomy category with wp_custom_pagination
- Parent cpt/child custom post type URL permalink relationship
- Query Only Show Text on Posts With Certain Taxonomy Tag
- Custom Taxonomy Showing in WP Menu
- Storing/querying custom date data
- Custom Template Taxonomy
- How to relate one custom post type to another custom post type
- How to make a single Menu Item call another Mega Menu for Custom Post Types and Custom Taxonomies?
- Links in archive not including taxonomy parameter
- the_post_navigation in single page with multiple taxonomies
- Url rewrite with custom post type and taxonomy