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
- Remove slug from custom post type post URLs
- Redeclare/Change Slug of a Plugin’s Custom Post Type
- Theme localization of “slugs” (custom post types, taxonomies)
- How to add current custom taxonomy slug to body class
- Change Slug of a Custom Post Type
- Using page slug in wp_query
- 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?
- Listing all slugs?
- Why WordPress is picking archive.php instead of page.php?
- Changing slug of all posts
- WordPress Custom Post Type – Rewrite Query
- WordPress different templates for same type custom post (but different slug)
- Update post if exist from PHP
- WordPress hook which triggers on post import
- Custom Post Type Advanced Slug
- How to handle new post from API request?
- Automatically update slug with latest title within custom post type [duplicate]
- Apply template by path/slug related to custom post type?
- How to handle this specific case of custom post type?
- Changing CPT slug and taxonomy already registered in parent theme
- Custom Post Type to replace Woocommerce products – page not found error
- Custom Post Type for Shortcode Use – Prevent it display as a post (with slug)
- How to use a specific custom field in a custom post type as slug
- Custom Post Types and Removing Slugs – should we do it?
- insert image with custom post type
- importing table data to custom post type
- sort by name (slug) custom post type
- Need to return a string as permalink insted of str_replace
- How can I get some of a posts meta data whilst it is still inserting?
- How to controll the Posts post type and general wondering about WP data structure
- Under What Conditions Can I name my CPT the same as my CPT Page?
- How to change CPT single post slug
- How do I set a post slug automatically based on taxonomy?
- Custom post type and multi taxonomies + customize url
- See if the email exists or not
- WP_Insert_Post creating duplicate posts when logged in
- Custom Post type dont use custom page template (slug is not right)
- Custom rewrite rule based on other custom post type title
- Use custom post type taxonomy between cpt slug and name
- wp_insert_post from XML feed only inserting first post
- Show code dependant on CPT & category
- What is the correct way that when creating a custom post type assign values to custom fields created with pods framework?
- How do I find out which (page) template file my custom child post is looking for?
- Difference between a default post type and a custom post type?
- Remove custom taxonamy slug with pagination
- How can I write slugs / permalinks as: custom post type -> custom taxonomy and custom post type -> custom taxonomy (one CPT and many taxo)?
- wp_insert_post deleting previous post custom meta
- Custom Post Type not using correct page template
- WordPress doesn’t respect Page slug in custom post type url pagination. Keeps getting removed
- Add %post_id% to slug of custom post type and prevent the “unique slug” thing that WP does?
- Output all terms slugs for a loop filter
- Published page but it is page not found
- Change permalink incrementor into pseudo-subdirectory
- add .html to custom post type with WPML
- How to insert post 6 times after user register like ask.fm
- wp_insert_post() creates duplicates with ‘post_status’ => ‘publish’
- Custom post type URL structure with site.com/custom_taxonomy_slug/post_name
- Custom Post Type duplicating slug for new posts
- automatic creation of custom post type articles
- Custom post type post_type_link gives “page not found” on any other custom post type
- Two CPT: one is using part of the custom rewrite slug from the other
- 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
- Custom taxonomy archive slug overwrites static page
- Slugs on hierarchical taxonomies
- Display a Custom Post Type within another with hierarchically slug
- Problem to get the link of the default ‘post’ post type like the orther custom types
- 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
- Can I override the permalink/slug on creation
- Get the custom post type slug but remove the rewrite prefix?
- Rewriting archive page slug to be different than custom post type slug
- Get full control over custom post type url
- Add a image to a post published on a CPT from the front-end
- custom post type archive slug vs. custom page template
- wordpress form processing to custom post type not working
- Add category slug as class attribute in a link array
- Relationship with 2 custom post types
- Costum post type with costum (sub)taxonomy
- Remove Custom Taxonomy Slug only without removing Custom post type slug in permalinks
- Category slug not showing for Custom Post Type
- Can’t make permalink of CPT work
- How to make nested custom post type slugs work
- Custom Post Type Rewrite Rule
- How can I retrieve the slug for a custom post type via name?
- WP Query Post Type with same Taxonomy name
- WP Query WordPress Post Type with the same Taxonomy name
- install.php Custom Taxonomy Term not being added to custom post
- Custom Post Type Slug / Page Slug Conflict – Prevent use of reserved slug on page save?
- Omitted Content After Post-Publish Insertion
- Ideal top-level slug methods
- WordPress pagination URL
- wp_insert_post not working for custom post type?
- is this a bug or not?
- After wp_insert_post() custom post type does not show in the admin