You can use register_post_type_args to modify slug of any custom post type.
You need to change portfolio slug to work? Then code should be like this.
add_filter( 'register_post_type_args', 'change_slug_portfolio_to_work', 10, 2 );
function change_slug_portfolio_to_work( $args, $post_type ) {
if ( $post_type == 'portfolio') {
$args['rewrite']['slug'] = 'work';
}
return $args;
}
Related Posts:
- Change the “page” slug in pagination
- Change author base slug for different roles
- Using custom/dynamic “slug” for a page
- Display posts with author in the url with custom post types
- How to seamlessly redirect between different archive and singular slugs?
- How to add dot(“.”) in post slug
- How to change default page slug?
- Handle category name URL rewrite before different post type slugs
- How to change ?lang=cn into /cn/
- custom htaccess rewrite rule for page
- Why is there /index.php/ in all my links? How do I remove it?
- Multiple Permalinks for Same Post
- Adding more pages to author pages
- Using Blog Parent Slug on Blog Posts Only
- Load a template page based on part of slug in wordpress
- Removing “category” from URLs then “add_endpoint()” won’t work…
- How do I change attachment slug from name to id
- Access files at new location using old file paths
- Adding special characters to slug?
- Rewrite URLs – Custom Post Type – Post Slug, Taxonamy Slug
- Preserve old website URL structure after migrating to WordPress
- How to change the Author Slug from Username to Nickname and deal with Special Characters
- Disable WordPress from changing URL slug when post is published
- Using URL rewrite to add custom URL for custom post type
- One off rewrite for single post-type slug (show normal page with same URL instead)
- Can’t use a specific custom URL (slug)?
- How to transform multiple parameter URL to clean URL
- Make the home page’s slug visible in the browser’s URL bar
- Trying to add array of paths to post permalink
- Changing the wordpress default search url to something like – …example.com/search?query=keyword
- How to add dot(“.”) in post slug
- WordPress is adding “category” word before my actual category name in url (and this is unsolicited)
- Change author base and slug in author link
- WordPress numeric (yearly) page names / disable yearly archives
- Post & Page with same slug
- How to add 2 variable rewrite rule?
- taxonomy term in URL slug won’t forward to the correct term for custom post like it does for default categories/normal posts
- Remove Page Slug from URL
- Needed to change slug to access page
- Pagination posts. Url format
- Change the slug ( url ) to a sequence number starting from 0 in the custom record type?
- Switch WordPress to non-absolute links? [closed]
- Custom Rewrite Rules
- URL Rewrite with Custom Variables
- htaccess rewrite, adding segment to url
- Custom Download Link
- ow to change cutsom page url of wordpress site using htaccess
- Retrieve query var within functions.php
- WordPress Custom Post Type – Rewrite Query
- rewrite rule generated with mpdf to a shorter version
- Name page template properly
- Show Mysql table elements as pages in WordPress
- WP in subfolder hidden by htaccess, but media links show the subfolder
- WP redirect rule doesn’t work
- URL rewrite in theme doesn’t seem to be working
- .htm re-write is adding an ending / to my URL bar
- database not responding on localhost
- Import images from self-hosted to WordPress.com
- modify URL with mod_rewrite or hook
- Rewrite rule that wp-login.php?action=register is left alone
- How to rewrite URL back to default custom URL if no destination found
- add_rewrite_rule refuses to function
- Append a parametter at first or last to a certain URL
- Creating a custom rewrite for a single page
- How to add logged in username after WordPress URL?
- Dynamic URL with rewrite rule not working
- How to get relative page for every post: /post-1/contact. /post-2/contact
- How to add Search URL parameters to a Page Template Page for Custom Post Type
- Passing a variable to hyperlink text?
- History API & URL for single long page
- WordPress Rewrite Rule to EITHER Match 1 or 2 Taxonomies when adding to URL
- Display categorised url
- Is it possible to rewrite a page URL from ID to name from an API?
- Dynamic URL Rewrite rule
- Root-relative paths being rewritten on ‘Edit Page’ [closed]
- Rewrite Rule added but showing 404 rather than specified page
- Url wordpress rewrite
- Get parameters and custom page template
- Blog List Page 404 With Custom Post Type Rewriting to Blog Parent
- Custom URL segment parameters for posts
- Direct Dynamic URL in root to a location within template
- Worpress url parse
- rewrite rules social share links
- add_rewrite_rule is not fired
- URLs ending with number higher than 2147483647 redirects to to domain.com/2147483647
- URL rewrite results in a 404, but everything should work!
- Custom URL scheme – paramters on custom post type
- WordPress Landing Page Redirection Issue
- Get content from other database table based on an ID and rewrite URL
- WordPress Custom Rewrite Rule
- URL Redirect in WordPress
- Rewrite function
- WordPress total posts per page changed and now 404 Http error comes out [closed]
- How to exclude my home page from url of my internal pages?
- How to create User friendly URL in WordPress?
- Later change of taxonomy slug base not changing permalink
- Rewrite and replace url wp-admin/edit.php and wp-admin/post-new.php
- How can I add_rewrite_rule for a custom post type to preserve the referral id
- `query_var` values empty in theme file after `add_rewrite_rule` redirection
- openlitespeed rewrite rules conversion from apache