WordPress is filled with slugs. Not the gastropod mollusks. More like in newspapers where every article gets its own "slug," a short identifying phrase -- often an abbreviated version of the headline, like "DEWEY BEATS TRUMAN". That phrase is unique; no other article gets that same slug. People, and computers, can use the slug to refer to that article and no other.
WordPress assigns an identifying slug to every post (and taxonomy term). That slug becomes part of the post's Permalink URL. This article details the WordPress items that gets slugs, how to edit slugs, why WordPress sometimes adds "-2" to your slug name, and rare but possible permalink conflicts (a.k.a, "collisions") between post and taxonomy slugs.
Every instance of these post types gets a slug (URL query parameter(s) shown in parentheses):
Every instance of these taxonomies also gets a slug (URL-query parameter in parentheses):
http://example.com/?name=random-tape-david-weinberg http://example.com/?pagename=about-transom http://example.com/?name=about-transom http://example.com/?post_type=attachment&name=first_day_school
http://example.com/?pagename=belgrade-elementary-school-new
http://example.com/?taxonomy=project-types&term=assessment
WordPress makes a slug from the post's title. Slugs use only lowercase alphanumeric characters, underscore, and dash ([a-z], [0-9], [_], [-]). When generating a slug from a title, WordPress does this:
Here's Lookin' @ You, Niño #Casablanca 1942-11_26 :-)This would be the WordPress-generated slug:
heres-lookin-you-nino-casablanca-1942-11_26
??? (for permalinks and no-permalinks): While your post/Page still has a Status of Draft, any changes you make to the title, will also change the slug. Once the post is Published, editing the title does not alter the slug.
The slug becomes the last part of your post's permalink URL. You my wish slug part of your permalink to be different than the title, perhaps shorter. To keep the same title but customize the slug:
All top-level parent page slugs (Pages and CPTs) must be unique. All Page slugs (and hierarchical CPT page slugs) with the same parent page must be unique. Attachment slugs must be unique among all post types (including nav_menu).
Attachment slugs must be unique slugs
wp-includes/post.php
.wp-includes/formatting.php
.wp-admin/includes/post.php
.wp-includes/functions.php
.wp-includes/formatting.php
.wp-includes/taxonomy.php
.wp-includes/taxonomy.php
.register_post_type and register_taxonomy uses sanitize_title_with_dashes
clean_term_cache
Introduction_to_Blogging#Pretty_Permalinks
images and other file attachments
term gets parent (if hier.) then -2
returned value is intended to be suitable for use in a URL