For details please see this answer : Remove Dash/Hyphen From WordPress CustomPosttype Permalink
In your functions.php :
function no_dashes($title) {
return str_replace('-', '', $title);
}
add_filter('sanitize_title', 'no_dashes' , 9999);
For particular type of post :
function no_dashes( $slug, $post_ID, $post_status, $post_type ) {
if( $post_type == "page" ) {
$slug = str_replace( '-', '', $slug);
}
return $slug;
}
add_filter( "wp_unique_post_slug", "no_dashes", 10, 4 );
Related Posts:
- Access post from post id in URL
- How to add category to: ‘wp-admin/post-new.php’?
- How to Check if a Page Exists by URL?
- Strategy for handling hierarchical pages with empty parent content
- Open WordPress ‘Add New Post’ admin page with parameters set via $_GET
- Group Posts by First Letter of Title
- How do you get all the urls of images attached to a post?
- How to allow slashes in single posts when i click in the edit permalink button
- Possible to create a permalink to sort with meta_key?
- how to grab first link in post… and of course call it
- How can I extract the URL of a link from a post?
- Create a separate JS application for an individual post?
- Remove slashes (both before and after) in relative post url
- Random post category URL
- Paginated Posts – Social Media Buttons Share First Page URL
- WordPress not opening posts with only numbers if permalink is post_name
- Assign category to new post via URL
- filter RSS feed in URL
- Turn On Comments On Custom Post Types in Directory Theme
- Permalink doesn’t get displayed in Twitter button (Local WordPress problem?)
- Retrieve post ID from “querying” URL
- Start post pagination at 0 instead of 1
- How do I Redirect a WordPress Page?
- Linking to pages/posts within the site
- WP move posts to different path
- Subdomain to website directory blog transferring
- Make insterted image point to post url instead of attachment page
- Post is blank when I click on the link
- How to get the latest URL of my blog?
- Inserting Media to WordPress Posts
- Custom Post Type, post-formats associated to custom post type > 404 archives
- Can Permalink structure of %postname%/%post_id% improve performance
- How to prevent to create same url of post, if the previous was deleted?
- Can I show category name in url for only one of my categories?
- WordPress posts have a different URL to the index
- Posting to WP via URL
- How to bulk Update URLs to new values?
- Permalink Short code showing unnecessary link text inside the loop
- Every time I try accessing a post it redirects me to the feed
- How can I make a post sub link?
- How to Best Create Separate Subscribers and User Experience
- Does having category name in permalinks affect SEO when having a post in multiple categories?
- How to add a ‘News’ section to specific posts in WordPress
- Template for displaying CPT / Taxonomy URL issues
- Show posts in a parent directory [duplicate]
- How to generate an HTML link automatically from URL in a users’ post
- Prevent Archive URLs
- Category URL to use same string as Post URL Permalink
- Querying posts from current category, using a variable as array argument
- If I moved the location of my generic “posts” page, do I need to change the slugs for all of the individual posts?
- Multipage Post URL correction
- Post & Category Archives URL structure
- Post URL duplication adds numerical value
- WordPress URL question
- Embed image in post from external url
- structure of posts and pages
- How to change post template via url?
- How to retrieve a post by inputing the url in a custom field and displaying it on an options page
- Post as frontpage – avoid duplicate content
- Custom URL Structure for posts with subcategories
- How can I display a specific number of post in a category via a url
- Is there a Standard Format for Clean URLs for Archives of Custom Posts?
- Create custom URL with different levels
- Moving Posts to a new site and maintaining URLs
- Make Show Notes for Individual Podcast Episodes Easy to Find (multiple URL’s?)
- Rewrite a specific Post Format to URL slug
- Change the default video URL in a post to shortcode format
- Choose options via url
- Default post type doesn’t display in url
- Do I need to create a multisite for querying posts from multiple WordPress sites?
- Post page still linked to old site
- Blog posts are not appearing as subs of Blog Page
- How to add paraent in Blog post URL in wordpress
- Modify Post URL Programmatically
- Get WordPress post content by post id
- Remove slug from custom post type post URLs
- Get page ID of page that is set as the posts page
- Get Posts Under Custom Taxonomy
- How to limit the number of posts that WP_Query gets?
- Stop WordPress Wrapping Images In A “P” Tag
- When is the ‘post_content_filtered’ column in database cleared by WordPress?
- Turn a URL into an Attachment / Post ID
- GET the excerpt by ID
- Stop WordPress automatically adding tags to post content
- Determine if page is the Posts Page
- How to get ‘post_content’ without stripping tags?
- How to add an admin notice upon post save/update
- Print Current Post Index number within Loop
- Should we trust the post globals?
- Optimize post insert and delete for bulk operations?
- Get the Current Page Number
- How do you add thumbnail support for custom post types?
- How to mark every 3rd post
- Change Posts per page count
- Keep featured content post in homepage with original order
- How to display related posts from same category?
- Can posts have parents?
- Is there a action hook for the “Empty Trash” button?
- How to end the excerpt with a sentence rather than a word?
- How do I check if I linked to a post before I delete it?