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
- Redeclare/Change Slug of a Plugin’s Custom Post Type
- Custom Post Type Slug / Page Slug Conflict – Prevent use of reserved slug on page save?
- Best way to flush_rewrite_rules for custom post type, in a mu-plugins plugin?
- Custom Post type & Taxonomy URL structure
- Multiple post types – share same ReWrite slug?
- Slug Formatting : Acceptable Characters?
- Combining Multiple Taxonomies in one URL
- How to modify URL structures in custom post types and taxonomies or terms
- Modify custom post type rewrite rules in a separate function
- Change page /2 to /transcript with a Rewrite
- Using %postname% tag with a Custom Permastruct creates 400 Bad Request Errors from the server
- Permalink rewrite with custom post type and custom taxonomy
- Custom Post Type – Same Post Name, Different Post Type
- Force unique page slugs across all post types
- Custom Slug for a custom post type and default post
- wrong template for page of archive
- Interesting Custom Post Type Slug with Taxonomy and Custom Field
- Get slug to point to different content of the same post
- Remove Taxonomy Slug when No Taxonomy is Assigned to Custom Post Type?
- Using custom post type parent as slug
- Add hierarchical taxonomy to permalink for custom post type
- How to Combine Two Custom Post Types into Single Permalink Structure
- How to rewrite custom post type with custom taxonomy urls?
- How to remove slugs from multiple custom post types
- Rewrite slug for CPT
- Rewrite slug of custom post type to include post-id
- How to change custom post type permalink structure
- Front custom edit post page for each post
- Remove the parent slug in a CPT URL
- Rewrite Question Mark in Post Template to Make it Pretty URL
- Index page with the same id as the slug
- Custom Post Type with Same Page URL
- CPT Template Not Showing – Getting 404
- Removed custom post type slug but not working for child pages
- Including taxonomy term before post type breaks top level pages
- How to get list of taxonomy slugs ordered parents>childs?
- Rewrite Endpoints and CPTs – How to use in a plugin
- Custom Post Type – Duplicate Page Slugs
- Remove permalink for custom post type
- How to make a posttype show under a page hierarchy (example.com/page/posttype/entry)?
- Relationship between set rewrite flag in register_post_type and add_rewrite_rule
- Rename a slug label
- How to add current custom taxonomy slug to body class
- Why WordPress is picking archive.php instead of page.php?
- Custom Post Type posts, conflict with posts after add_rewrite_rule to top
- Combine multiple CPT names to create valid permalinks
- Custom Post Type – Rewite Archive page
- 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]
- How to rewrite the post slug of a custom post type post
- rewriterule not working
- How to use a specific custom field in a custom post type as slug
- 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
- Custom post rewrite rule not working
- Subpages Permalinks Issues
- rewrite rules hierarchical
- How to change CPT single post slug
- How to make a post accessible from multiple post type slugs?
- How do I set a post slug automatically based on taxonomy?
- Rewrite URL for CPT to domain/post-name/post-id
- How to apply multiple rewrite_rule to a single custom post type url?
- Custom permalink structure for custom post types including multiple taxonomy
- Difference between a default post type and a custom post type?
- CPTs relationship
- Custom Post Type not using correct page template
- Rewrite url for custom post type with specific url
- Custom post type URL structure with site.com/custom_taxonomy_slug/post_name
- Custom post type post_type_link gives “page not found” on any other custom post type
- Slugs on hierarchical taxonomies
- Group based routing and administration
- Adding Custom Taxonomy Along-with Post Name in Post Type Permalink
- Problem to get the link of the default ‘post’ post type like the orther custom types
- how to use two permalinks for one custom post type based on categories
- Can I override the permalink/slug on creation
- Rewriting archive page slug to be different than custom post type slug
- Get full control over custom post type url
- custom post type archive slug vs. custom page template
- Custom Rewrite Tag Structure
- Relationship with 2 custom post types
- Parent cpt/child custom post type URL permalink relationship
- WordPress pagination URL
- Custom archive URL as a subfolder of the custom post type slug
- Is it possible to use a post name in a custom post slug?
- Custom slugs with dates & IDs on Custom Post Type
- Add post id to url instead of WordPress default -2 suffix
- Taxonomy Archive URL + Template