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?
- How to create a front end user profile with a friendly permalink
- How to make pages slug have priority over any other taxonomies like custom-post, post or category
- Rewrite URL – how to do a SEO-friendly Unicode custom URL?
- add_rewrite_rule() not playing nice with child pages
- rewrite_rule() not preserving the query string
- Appending numbers to url do not break the link
- How to Change Author Posts URL
- Change Attachment Post URLs to File URLs
- WordPress 404 unless there is a space in url
- Change permalink for default archive – yearly
- How to get “extended” path info from URL in a plugin
- Custom URL routing based on cookie value
- Rewriting rules: difference between ‘init’, ‘rewrite_rules_array’, ‘generate_rewrite_rules’?
- How to perform a query at the URL?
- url rewriting for most recent post
- Remove Query String from URL on Redirect – Redirection Plugin
- Cleanup URL for a custom page in wordpress
- WordPress rewrite rules don’t need ^?
- How to rewrite url wordpress?
- WordPress Redirecting Non Category Pages /page/nnn to their Canonical URLs
- How to create a profile page for specfic / custom user role members?
- Index page with the same id as the slug
- How to remove trailing slash from root WordPress folder?
- Rewriting the URL of a custom post to a certain page
- Persist url parameter passed by a referrer website? [duplicate]
- Rewrite /category/cars into /topics/cars
- show ALL latest posts with archive.php on example.com/latest
- Adding a query string to only one page url
- Url rewrite with htaccess
- force www rewrite if wordpress put in a folder
- Current post ID – relative url
- add_rewrite_rule – Page Slug from “/foo-bar/” to “/foo/bar/”
- How to use wp rewrite to hide form action url?
- change the url in wordpress
- Redirect URL to an existing page with query string or #! added on
- Add extra optional text to permalink e.g. “-with-*”
- change url for portfolio image
- remove archive from url :: marketpress
- add_rewrite_rule with optional parameters
- How to change url of specific posts with name of a root page
- Redirect empty search to another page
- WordPress URL redirect and replace ? question mark
- Rewrite rule not working, suspect redirect string
- Fresh install redirects to www, breaking page loads
- Rewrite Url using .htaccess or hook
- url restructure or rewrite having $_GET variables
- Error 404 wordpress redirecting URL
- What’s the best approach to do this?
- Font Page overrides rewrites
- WordPress Rewrite: Ignore Specific Pattern
- rewrite rule for home/index page
- WPNetwork with custom URL Rewrite rules
- URL Rewriting in WordPress
- Rewrite URL variable to custom path
- Own code on index.php wordpress theme file, help with the rewrite rules
- URL rewrites af
- How to change search url produced by ‘s GET method?
- Hide / rewrite download link
- Spurious URL structure (Adding extra /0/s)