For normal posts you can set the permalink structure on Settings → Permalinks.
All details can be found in the Codex
For custom post types you can set the slug when you registering it:
add_action( 'init', 'create_posttype' );
function create_posttype() {
register_post_type( 'cpost',
array(
'labels' => array(
'name' => __( 'cpost' ),
'singular_name' => __( 'cpost' )
),
'public' => true,
'has_archive' => true,
'rewrite' => array(
'slug' => 'cpost',
'with_front' => true
),
)
);
}
Hope that helps,
Cheers
Related Posts:
- Add .html (dot HTML) extension to custom post types
- How to have a custom URL structure for a custom post type?
- WordPress custom post type url change
- remove post-name from title in custom post type
- Rewrite Custom Post Type URL slug
- Query var removed after rewrite
- Custom Post type and permalink settings
- Custom Post Types, URL rewrite on multiple CPTs
- Get Taxonomy Term Title by it’s URL
- Front custom edit post page for each post
- How to build custom route by adding taxonomies to URL ? ex: www.demo.com/communities/palo-alto/
- Rewrite Question Mark in Post Template to Make it Pretty URL
- Taxonomy in URL
- Custom Post Type Category URL
- How to create custom search result page with custom URL parameters for custom post type?
- Custom post type URL
- Custom Post Type URL Rewrite’s
- returning the currect URL for nested posts
- I want to rewrite the URL of a specific post with a specific custom field to easily analyze in Google Analytics
- Add %post_id% to slug of custom post type and prevent the “unique slug” thing that WP does?
- Force WordPress to only match URL in category
- Custom post type with parent page? Possible?
- Customize category URL
- Menu Structure and URL structure, with Pages and Post-Type-Posts
- Custom Post Type with multiple Custom Taxonomies / Hide Taxonomy Slug from URL
- Custom post type with custom taxonomies structure url not working archive of CPT
- Rewrite rule taxonomy url with different values in one function
- Possible to change the URL for the regular post type without affecting the URL of other custom post types?
- 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
- 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
- Pagination throws 404
- Permalinks for CPT breaks permalinks to pages
- 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
- 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
- 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
- URLs for child terms
- 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
- add_rewrite_rule and passing variables for custom post types
- Custom URLs in post types make it impossible to view archive
- Custom Permalinks for Custom Post Types
- Share root slug for Child Page and Custom Post Type (prioritizing child pages over posts)
- How to create connection among state, city, store and store number based on URL
- Route subpage to Custom Post Type
- Programmatically add custom field to post_name in a custom post type
- Custom Post Type Advanced Slug
- Rewrite permalink for multiple post types (CPT) with taxonomy term
- How to constrain the results to a specific post_type on tag archive page?
- Pagination for custom post types – url rewriting
- How to add page under a custom post type?
- Post/Custom Post Type URL Access
- Custom Post Type Date Based Archive URL rewrite [duplicate]
- Custom rewrite rule takes place AFTER the generic category rule
- Adding /blog in front of single posts (only)
- multiple URLS for the same page
- Custom rewrite rule based on other custom post type title
- Define multiple prefixes for custom post type
- URL for archive of custom post type with 2 taxonomy terms
- Query custom post type and custom field by URL parameters
- Custom Post Type parent/child relationship rewrite rules for permalinks
- Custom Post Type canonical link / pagination redirecting to root
- How to manage a custom post type archive as a page?
- Remove custom post type slug but keep related category taxonomy permalink
- page not found for example.com/custom-post-name
- Do not output category and tag URLs
- current_menu_parent for custom post type and custom url
- Cannot get query var ‘post_type’ to work
- Custom post type and custom taxonomy archive inaccessible
- Removing custom post type name in single article URLs
- Links in archive not including taxonomy parameter
- How to rewrite custom slugs that follow my rules
- What is the best way to relate different custom post types?
- Allow child pages with the same base as the CPT slug