Both of these are controlled by the arguments passed to register_post_type
, specifically, the rewrite
and has_archive
arguments:
$args = [
'rewrite' => ['slug' => 'article'],
'has_archive' => 'articles',
// the rest of your arguments...
]
Related Posts:
- How to achieve this permalink -> category-name/custom-post-type-name/post-name
- Prepend meta_value to permalink of post
- Priority for Categories, Tags, Taxonomies, Posts, Pages and Custom Posts with same url
- Custom Post Type pagination when CPT ‘rewrite’ rule and a page have the same slug
- CPT custom archive template does not get loaded
- Am I using the flush_rewrite_rules function in the right place?
- Adding Post id to the end of slug in a Custom Post Type
- Two CPT: one is using part of the custom rewrite slug from the other
- Custom taxonomy archive slug overwrites static page
- Get the custom post type slug but remove the rewrite prefix?
- How to make nested custom post type slugs work
- Ideal top-level slug methods
- Same slug for Custom Taxonomy archive and CPT archive – Rewrite rule not working
- How to change rewrite slug for custom post type without conflicting w/ child pages of page with same slug
- Properly flush rewrite rules on plugin activation
- How to make a posttype show under a page hierarchy (example.com/page/posttype/entry)?
- Custom Post Type archive-{post-type}.php not working
- Custom post type single page (single-{CPT-name}) 404 when slug includes hyphens
- How do you create %post_type%/%postname%/ permalink structure?
- Relationship between set rewrite flag in register_post_type and add_rewrite_rule
- How to query 2 custom post types that need to share a slug?
- Slug for custom post type
- Custom rewrite to fetch feed data
- Rename a slug label
- Custom Rewrite Rule for Custom Post Type with URL Param
- Slug Confusion Between Post and Custom Post types?
- WordPress custom slug rewrite
- How to find a specific post_type using its “rewrite slug”?
- Different slug taxonomy for two different CPT
- How to add current custom taxonomy slug to body class
- Change Slug of a Custom Post Type
- Using page slug in wp_query
- How can Custom Post Type and a page have the same slug?
- custom post type archive page has 404 error even though has_archive is true
- Custom post type paging 404 error
- How to get postname in custom page?
- Custom Permalinks for Custom Post Types
- Listing all slugs?
- Why WordPress is picking archive.php instead of page.php?
- Postname on unique permalink structure appends “-2” for a custom post type. How can I get this to stop happening?
- Custom Post Type posts, conflict with posts after add_rewrite_rule to top
- Changing slug of all posts
- Combine multiple CPT names to create valid permalinks
- WordPress Custom Post Type – Rewrite Query
- Custom Post Type – Rewite Archive page
- WordPress different templates for same type custom post (but different slug)
- SEO Concerns With Rewrite Rules
- Set parent for custom post type archive rewrite url
- Route subpage to Custom Post Type
- Custom Post Type Advanced Slug
- How to rewrite custom taxonomy term archive to use THE SAME SLUG/front as CPT
- Automatically update slug with latest title within custom post type [duplicate]
- Apply template by path/slug related to custom post type?
- Rewrite permalink for multiple post types (CPT) with taxonomy term
- Changing CPT slug and taxonomy already registered in parent theme
- Custom Post Type to replace Woocommerce products – page not found error
- WordPress custom permalink and archive link for custom post type
- How to rewrite the post slug of a custom post type post
- Custom Post Type for Shortcode Use – Prevent it display as a post (with slug)
- rewriterule not working
- How to use a specific custom field in a custom post type as slug
- Custom Post Types and Removing Slugs – should we do it?
- Pagination for custom post types – url rewriting
- Custom Post Type with modified permalink structure results in 404
- Modifying rewrite rules to use /category//
- Custom Endpoint For Custom Post Type from Child Theme
- Custom post types and custom variables — add_rewrite_tag() not working
- Add Custom Values to Permalinks Through Custom Fields and Posts
- sort by name (slug) custom post type
- Need to return a string as permalink insted of str_replace
- Why do I need to register my custom post type a second time when flushing rewrite rules?
- How to controll the Posts post type and general wondering about WP data structure
- Under What Conditions Can I name my CPT the same as my CPT Page?
- Custom post rewrite rule not working
- Subpages Permalinks Issues
- WordPress custom taxonomy page
- rewrite rules hierarchical
- Custom Post Type Date Based Archive URL rewrite [duplicate]
- Rewrite rules for custom post type
- Custom taxonomy and post type rewrite rules
- Pages not appearing?
- How to change CPT single post slug
- WordPress rewrite rule doesn’t work unless post category is explicitly called in regex
- Url Rewriting a dynamic wordpress page with parameters
- How to make a post accessible from multiple post type slugs?
- Remove cpt slug from url and use custom taxonomy instead breaks all other cpt
- How do I set a post slug automatically based on taxonomy?
- Custom post type and multi taxonomies + customize url
- Custom Post type dont use custom page template (slug is not right)
- multiple URLS for the same page
- Rewrite URL for CPT to domain/post-name/post-id
- Custom rewrite rule based on other custom post type title
- Custom Post Type add_rewrite_rule
- Use custom post type taxonomy between cpt slug and name
- How to apply multiple rewrite_rule to a single custom post type url?
- How to properly set the rewrite rules for this case?
- Show code dependant on CPT & category
- Category permalinks don’t work even after flushing
- Custom permalink structure for custom post types including multiple taxonomy
- Difference between a default post type and a custom post type?