The implementation of clean URLs involves
URL mapping via pattern matching or transparent
rewriting techniques. As this usually takes place on the server side, the clean URL is often the only form seen by the user. For search engine optimization purposes, web developers often take this opportunity to include relevant keywords in the URL and remove irrelevant words. Common words that are removed include
articles and
conjunctions, while descriptive keywords are added to increase user-friendliness and improve search engine rankings. while others use a broader definition emphasizing that legible slugs are more user-friendly. The name
slug is based on the usage by the news media to indicate a short name given to an article for internal use. Slugs are typically generated automatically from a page title but can also be entered or altered manually, so that while the page title remains designed for display and human readability, its slug may be optimized for brevity or for consumption by search engines, as well as providing recipients of a shared bare URL with a rough idea of the page's topic. Long page titles may also be truncated to keep the final URL to a reasonable length. Slugs may be entirely lowercase, with accented characters replaced by letters from the
Latin script and
whitespace characters replaced by a
hyphen or an
underscore to avoid being
encoded. Punctuation marks are generally removed, and some also remove short, common words such as
conjunctions. For example, the title
This, That, and the Other! An Outré Collection could have a generated slug of . Another benefit of URL slugs is the facilitated ability to find a desired page from a long list of URLs without page titles, such as a minimal list of opened
tabs exported using a
browser extension, and the ability to preview the approximate title of a target page in the browser if
hyperlinked without title. If a tool to save web pages locally uses the string after the last slash as the default
file name, like
wget does, a slug makes the file name more descriptive. Websites that make use of slugs include
Stack Exchange Network with question title after slash, and
Instagram with ?taken-by=
username URL parameter. == See also ==