If the slug exsit WordPress will add a number to the end. For example if you had two post named “test” you would get “test” and “test-1”
Hope that helps
Related Posts:
- Generate slug and meta data if meta field is empty
- Theme localization of “slugs” (custom post types, taxonomies)
- How do I get a post (page or CPT) ID from a title or slug?
- custom slug for custom post type
- Disable permalink on custom post type
- Get list of all registered post types slugs
- Get post ID from wp_insert_post()
- Using Custom Fields in Custom Post Type URL
- Dynamic taxonomy in permalink made all other posts NOT FOUND?
- Post slug changed using code doesn’t reflect on editor when post is published
- Taxonomy page returns 404 page not found
- Setting a title on a Custom Post Type that doesn’t support titles
- Reslug a Custom Post Type
- Removing CPT slug from URL results in 404 error for archive page
- Custom Post Type pagination when CPT ‘rewrite’ rule and a page have the same slug
- Getting Post ID from slug during init
- wp_insert_post custom taxonomy
- Custom post type’s slug gets wrong when adding a custom meta box
- Rewrite CPT slug with two taxonomy slug instead of one
- What hook should be used to programmatically create a post only when master post is updated?
- Can’t edit Custom Post Type slug/permalink
- Custom Permalink with Dynamic Taxonomy for Custom Post Type – Works, but breaks other permalinks
- Custom Taxonomy breaking pages permalinks
- WordPress tax_input only if logged in
- Custom Post Type with two hierarchical Custom Taxonomies: strategy to generate best permalink structure
- Custom post type with slug for plural (archive) and for single
- Rewrite rules for custom post type slug
- Automaticly add slug to posts
- Make slug as ID Number for custom post types
- How to auto increment post title & post slug field?
- Custom post type and taxonomy slug issue
- Custom post types archive redirect
- Does WordPress limit the length of slug names for Post Meta or Terms?
- Remove post type slug of all post types from permalinks
- CPT custom archive template does not get loaded
- Am I using the flush_rewrite_rules function in the right place?
- create parent post using wp_insert_post
- Rewrite post type slug only for child theme
- Child post with numeric only slug keeps redirecting to parent
- How to add a post slug to a url?
- Permalink for a custom post type isn’t working and I don’t know why
- Cron job for creating posts not excecuting properly
- How can I make the slug of the taxonomy also the slug of the custom post
- Assign same parrent Page to pages AND custom post types
- Allow duplicate slugs for custom post type with taxonomies
- Nested Custom Post Type or Custom Post Type Parents?
- Programmatically rewriting slug through functions.php but returns 404
- Multiple (two) category postings on the same page.
- Post author for revision not being set on update/insert
- Why cant I add a custom post type to a custom taxonomy?
- How do you create %post_type%/%postname%/ permalink structure?
- Slug for custom post type
- Slug Confusion Between Post and Custom Post types?
- Different slug taxonomy for two different CPT
- Programatically inserted posts not showing in Posts Table
- How can Custom Post Type and a page have the same slug?
- How to get postname in custom page?
- Is it possible to add posts and images (auto resize) for custom post types with a script?
- WordPress Custom Post Type – Rewrite Query
- How to handle new post from API request?
- How to handle this specific case of custom post type?
- Changing CPT slug and taxonomy already registered in parent theme
- Custom Post Type for Shortcode Use – Prevent it display as a post (with slug)
- Custom Post Types and Removing Slugs – should we do it?
- Need to return a string as permalink insted of str_replace
- Custom post type and multi taxonomies + customize url
- WP_Insert_Post creating duplicate posts when logged in
- Use custom post type taxonomy between cpt slug and name
- Show code dependant on CPT & category
- How can I write slugs / permalinks as: custom post type -> custom taxonomy and custom post type -> custom taxonomy (one CPT and many taxo)?
- Published page but it is page not found
- Change permalink incrementor into pseudo-subdirectory
- How to insert post 6 times after user register like ask.fm
- wp_insert_post() creates duplicates with ‘post_status’ => ‘publish’
- Custom Post Type duplicating slug for new posts
- automatic creation of custom post type articles
- WordPress page not showing up – replaced with last 10 posts?
- Custom permalink rewrite rules – how do I fix this?
- WP gives 404 error for custom post type with GET variable
- Display a Custom Post Type within another with hierarchically slug
- Submitting custom post from frontend,jQuery ajax, and custom validation – can’t find proper place to insert wp_insert_post()
- UPDATED: Save a custom_field value when automatically creating a post using wp_insert_post
- Getting a 404 on single custom post type page when using rewrite on a custom taxonomy
- wordpress form processing to custom post type not working
- Costum post type with costum (sub)taxonomy
- Remove Custom Taxonomy Slug only without removing Custom post type slug in permalinks
- Custom Post Type Rewrite Rule
- How can I retrieve the slug for a custom post type via name?
- WP Query WordPress Post Type with the same Taxonomy name
- install.php Custom Taxonomy Term not being added to custom post
- Omitted Content After Post-Publish Insertion
- Ideal top-level slug methods
- wp_insert_post not working for custom post type?
- After wp_insert_post() custom post type does not show in the admin
- Create page using same slug as custom post type
- Custom Post Type with multiple Custom Taxonomies / Hide Taxonomy Slug from URL
- Is it possible to use a post name in a custom post slug?
- Custom slugs with dates & IDs on Custom Post Type
- Add post id to url instead of WordPress default -2 suffix
- Taxonomy Archive URL + Template