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
- How to add/assign or change featured image in post programmatically?
- WP-CLI Bulk delete posts from specific category
- Update all posts automatically when using post_meta
- Post ids are incrementing by an unknown number?
- Can’t show comments count per post outside loop
- Redirect based on user post count
- How to Add ‘Post Categories’ to the Dashboard Sidebar
- Remove the Edit button in posts for permalinks on certain user roles? WP 3.3
- Show total author’s post views by posts post_meta
- Custom loop pagination links not working
- If in_category not working for multiple single.php pages
- display random posts on index.php instead of latest
- Automatically Import WordPress Blog to Facebook Page [closed]
- Split post title for styling
- Pull in posts using post meta for REST API
- Avoiding duplcate posts on the main page
- How to work with posts and sub posts?
- getting custom post by tag
- How to make an image appear as a thumbnail in the blog post?
- Not display post meta if empty
- post_name is not stored until post is published… where should I store my slug until it goes live then?
- How to organise post by category and date
- Show post if in category
- How to include Related Posts in WP RSS feed
- retrieve post slug by post_tags taxonomy
- Hide the contents for specific post
- How can I fixe the article title problem?