This will be done when you register_post_type :
$args = array(
'rewrite' => array( 'slug' => 'book' ),
);
register_post_type( 'book', $args );
IMPORTANT ! Remember to go to wp-admin options > permalink and click SAVE on that page for the changes to take effect.
Related Posts:
- Pretty permalinks for search results with extra query var
- Does WordPress automatically do 301 redirect if I change permalink
- ‘post_type_link’ filter not working
- Broken wordpress permalinks on pages only
- Post being redirected to attachment post
- Without index.php in permalinks I get 404 across site
- Changing Permalinks to a Custom Permalink causes a 404 Error [no matter what I do]
- Change website URL without breaking links or images? WP 3.3
- Redirect user if it’s not logged in
- Random Alphanumeric Key URLs
- How to get this JavaScript working with get_permalink
- Add a css class to a taxonomy permalink
- Search result permalink
- Permalinks Structure and 404 Question
- Change of permalink structure – redirects in htaccess breaks the archive links
- Change permalinks with ACF values
- template_include not loading -instead goes to index.php
- Add a URL prefix to permalinks of News category and sub-categories of posts only
- How to achieve a clean custom permalink solution?
- How can I make my .htaccess file writeable by wp-admin?
- Custom taxonomy rewrite using tax name instead of rewrite slug
- Disable permalinks on all pages and posts
- Custom add_rewrite_rule & permalinks
- How do I get all the URLs from my WordPress site?
- add_rewrite_rule not working for me
- Using WP Rewrite, but just not “getting it”
- Confusing about permalink
- List / Get post redirects
- Title attributes on Permalinks for posts and products
- Permalinks problem – Category pages don’t work
- Rewrite CPT permalinks and include WPML language
- Need To Add Custom rewrite base url for individual user
- example.com/index.php/%postname is working while /%postname is not working WordPress on IIS6
- 301 Redirect for Non-Date Based URL’s
- WordPress is suppressing page extensions!
- Strange number at the end of wordpress permalinks
- Custom permalink structure gives 404
- Category with the same slug
- rewrite rule to redirect to the most recent date permalink
- File access different with permalinks on and off
- Permalinks settings
- mod-rewrite exception? keep #hash in matching urls?
- Changing permalinks structure without loosing SEO
- Change Structure Permalink => Error 404? How to redirect
- how do links move when I move my site?
- Permalink for specific page name
- get_posts post title permalink not working for last item in array
- Comment author url link is wrong? How to change from authors/ to author/
- Direct link to post when multiple categories are selected
- Add category into post permalink
- Add post overwriting permalink from previous post in 4.6
- Make custom post available under main domain directly?
- Getting an ID from a URL, why can WP do this itself, but none of of the functions provided get it right?
- Custom permalink structure with %postname% in front of domain name
- Add variables to all permalinks in site
- Big arabic permalinks not work
- Fix 404 error after changing permalink structure
- How can I set up a secondary permalink structure?
- External PHP file & Pretty Permalink
- What is the right way to clean up $title before wp_insert_post?
- How to get links to user and tag by its name?
- Help me fix these crazy attachment page URLs (rewrite?)
- Unable to rename permalink
- How to Use metada Value in Url and is it possible? [duplicate]
- Custom child page permalink
- How to allow slash(/) on page url
- Safest way to create a custom permalink
- How do I structure my permalinks in WordPress?
- Parent/Child Categories Permalinks
- WordPress wildcard route to page
- An excluded ‘ghost’ page is crashing my permalink
- WordPress Attachment Page URL Rewrite!
- Customize URL for specific tags archive
- Yoast and permalink troubleshooting
- Permalink Issue | Too many redirects
- WordPress project redirecting to a blank index.php when i use custom templates
- Parent/Child Relationships with Multisites?
- Custom Permlinks work, regular page permalinks don’t
- How to redirect from old standard wordpress permalink structure to new custom one
- wp_dropdown_categories links 404
- Permalink problem ( Blog posts vs custom post types)
- Search and replace post URL’s on page output?
- Two urls for one website
- Added incorrect rewrite rule now getting an error
- Accidentally changed the permalink structure
- Keep wordpress from modifying my permalinks
- get_permalink wrongfully returns only year and month and not all the link
- Link to most recent child page
- Permalink Issue – Funny & Weird
- WordPress permalink still not working (error or not understood?)
- customize urls displayed by previous_post_link and next_post_link
- Pagination is not working, how to trace it properly?
- Problem when i configure permalink
- Files placed in directory with wordpress 404
- wordpress home is gone
- how to create several url aliases for a page
- Permalinks Won’t Work
- Post URL not working according to permalink setting
- Strip category base from URL?
- My permalinks no longer have the “news” category prefix in the link and it’s causing 404 errors for articles published on the web