Make the slug translatable when you register the custom post type:
register_post_type(
'post_type_name',
array (
'rewrite' => array (
'slug' => _x( 'post_type_name', 'URL slug', 'your_text_domain' )
)
)
);
Then create a small plugin for the site where you want to change the slug:
add_filter( 'gettext_with_context', 'change_my_slug', 10, 4 );
function change_my_slug( $translation, $text, $context, $domain )
{
if ( 'URL slug' !== $context or 'post_type_name' !== $text or 'your_text_domain' !== $domain )
return $translation;
return 'changed-slug';
}
Related Posts:
- Change slug of registered custom post type in child theme
- Taxonomy page returns 404 page not found
- Prepend meta_value to permalink of post
- Removing CPT slug from URL results in 404 error for archive page
- Getting Post ID from slug during init
- Interesting Custom Post Type Slug with Taxonomy and Custom Field
- Rewrite rules for custom post type slug
- How to remove slugs from multiple custom post types
- Change custom post type slug from plugin options
- Custom rewrite url category
- Index page with the same id as the slug
- How can I make the slug of the taxonomy also the slug of the custom post
- Programmatically rewriting slug through functions.php but returns 404
- Including taxonomy term before post type breaks top level pages
- WordPress Custom Post Type – Rewrite Query
- Custom Post Type Advanced Slug
- Changing CPT slug and taxonomy already registered in parent theme
- Custom Post Types and Removing Slugs – should we do it?
- Custom rewrite rule based on other custom post type title
- Custom Post Type not using correct page template
- Add %post_id% to slug of custom post type and prevent the “unique slug” thing that WP does?
- Two CPT: one is using part of the custom rewrite slug from the other
- Cannot modify a registered custom post type rewrite slug
- Custom Post Type Rewrite Rule
- Custom Post Type with multiple Custom Taxonomies / Hide Taxonomy Slug from URL
- Custom post type Premalinks main page and details page
- Custom slugs with dates & IDs on Custom Post Type
- Add post id to url instead of WordPress default -2 suffix
- Custom Post type & Taxonomy URL structure
- How to pass URL parameters for advanced taxonomy queries with multiple terms for one custom taxonomy
- Combining Multiple Taxonomies in one URL
- Slug for custom post type archive
- Permalink rewrite with custom post type and custom taxonomy
- Add pre-existing meta box to new custom post type
- Custom Post Type – Same Post Name, Different Post Type
- How would I leverage custom Taxonomies in this scenario?
- Priority for Categories, Tags, Taxonomies, Posts, Pages and Custom Posts with same url
- How to remove thumbnail sizes for specific post type on a child theme?
- Get slug to point to different content of the same post
- Is slug “type” reserved and can’t be used in taxonomy rewrite?
- Custom Post Type get_post_type_archive_link( $post_type ) returns false
- Using custom post type parent as slug
- Permalinks when filtering multiple custom post types by single taxonomy
- custom taxonomy archive by year
- How can you handle rewrite rules for custom post types with option to filter on custom taxonomy terms?
- Create a post in custom post type using field in registration form after users submit form
- Conditional regex in add_rewrite_rule() for specific query filters & pagination
- Displaying Posts of a Custom Type
- Wrong generated page_name/slug on first publish of custom post type
- Can’t change first part of URL rewrite for custom post type
- CPT Archive with core Category
- Stop / prevent WordPress from updating permalinks of custom post type
- Relative URLs for a particular custom post type?
- Custom Taxonomy URL are redirecting to page with the same name
- How to change custom post type permalink structure
- Front custom edit post page for each post
- Categories of Custom Post throws gives 404
- How to build custom route by adding taxonomies to URL ? ex: www.demo.com/communities/palo-alto/
- How Can I Change the Custom Post Type Slug to the Taxonomy Slug in the URL?
- Use same slug base for Custom Post Type posts, and multiple taxonomy terms
- Custom Post Type with Same Page URL
- WordPress custom post type split into pages
- Correct procedure for advanced permalinks
- Custom Post Types hierarchy and rewrite
- How to get list of taxonomy slugs ordered parents>childs?
- Rewrite Endpoints and CPTs – How to use in a plugin
- Custom post type’s permalink adds the name of the post type before the post name
- Custom taxonomy and post type with same slug
- How to make a posttype show under a page hierarchy (example.com/page/posttype/entry)?
- How to add current custom taxonomy slug to body class
- I can’t access custom taxonomy page listing
- Why WordPress is picking archive.php instead of page.php?
- Combine multiple CPT names to create valid permalinks
- Child theme blocks post from publishing [closed]
- How to rewrite custom taxonomy term archive to use THE SAME SLUG/front as CPT
- How to create custom search result page with custom URL parameters for custom post type?
- rewriterule not working
- Custom Post Type View Button in Admin Gives 400 Error
- How to controll the Posts post type and general wondering about WP data structure
- Custom Post Type URL Rewrite’s
- restricting custom rewrite to just one custom post type
- How do I set a post slug automatically based on taxonomy?
- Rewrite URL for CPT to domain/post-name/post-id
- Get only parent post in archive post
- How to apply multiple rewrite_rule to a single custom post type url?
- Custom permalink structure for custom post types including multiple taxonomy
- How can I assign multiple parents to CPT?
- CPTs relationship
- Customise Permalink Structure For Custom Post Types
- How to make “single post” permalink maintain it’s sub-page structure
- Custom post type post_type_link gives “page not found” on any other custom post type
- Problem to get the link of the default ‘post’ post type like the orther custom types
- How Can a CPT in WordPress have a page 2 without an error?
- Get the custom post type slug but remove the rewrite prefix?
- Rewriting archive page slug to be different than custom post type slug
- Remove sequential number from permalinks
- custom post type archive slug vs. custom page template
- Parent cpt/child custom post type URL permalink relationship
- How to make nested custom post type slugs work
- Menu Structure and URL structure, with Pages and Post-Type-Posts