<p>Many websites, including this one, add what are apparently called <em>slugs</em> - descriptive but as far as I can tell useless bits of text - to the end of URLs.</p>

<p>For example, the URL the site gives for this question is:</p>

<p><a href="https://stackoverflow.com/questions/47427/why-do-some-websites-add-slugs-to-the-end-of-urls"><code>https://stackoverflow.com/questions/47427/why-do-some-websites-add-slugs-to-the-end-of-urls</code></a></p>

<p>But the following URL works just as well:</p>

<p><a href="https://stackoverflow.com/questions/47427/"><code>https://stackoverflow.com/questions/47427/</code></a></p>

<p>Is the point of this text just to somehow make the URL more user friendly or are there some other benefits? </p>

[{'answer_id': 47428, 'author': 'Espo', 'author_id': 2257, 'author_profile': 'https://Stackoverflow.com/users/2257', 'pm_score': 8, 'selected': True, 'text': '<p>The slugs make the URL more user-friendly and you know what to expect when you click a link. Search engines such as Google, rank the pages higher if the searchword is in the URL.</p>\n'}, {'answer_id': 47429, 'author': 'Michiel van Oosterhout', 'author_id': 4830, 'author_profile': 'https://Stackoverflow.com/users/4830', 'pm_score': 5, 'selected': False, 'text': '<p>Usability is one reason, if you receive that link in your e-mail, you know what to expect.\nSEO (search engine optimization) is another reason. Search engines such as google will rank your page higher for the keywords contained in the url</p>\n'}, {'answer_id': 47451, 'author': 'Tom', 'author_id': 3715, 'author_profile': 'https://Stackoverflow.com/users/3715', 'pm_score': 3, 'selected': False, 'text': '<p>Remove the formatting from your question, and you\'ll see part of the answer:</p>\n\n<p><a href="https://stackoverflow.com/questions/47427/"><code>https://stackoverflow.com/questions/47427/</code></a></p>\n\n<p>vs</p>\n\n<p><a href="https://stackoverflow.com/questions/47427/why-do-some-websites-add-slugs-to-the-end-of-urls"><code>https://stackoverflow.com/questions/47427/why-do-some-websites-add-slugs-to-the-end-of-urls</code></a></p>\n\n<p>With no markup, the second one is self-descriptive.</p>\n'}, {'answer_id': 47459, 'author': 'DGentry', 'author_id': 4761, 'author_profile': 'https://Stackoverflow.com/users/4761', 'pm_score': 4, 'selected': False, 'text': '<p>The reason most sites use it is probably SEO (Search Engine Optimization). Yahoo used to give a reasonable weighting to the presence of the search keyword in the URL itself, and it also helped in the Google result as well.</p>\n\n<p>More recently the search engines have lowered the weighting given to keywords in the URL, likely because the technique is now more common on spam sites than legitimate. Keywords in the URL now have only a very minor impact on the search results, if at all.</p>\n\n<p>As for stackoverflow itself, SEO might be a motivation (old habits die hard) or simply for usability.</p>\n'}, {'answer_id': 47515, 'author': 'Chris Bartow', 'author_id': 497, 'author_profile': 'https://Stackoverflow.com/users/497', 'pm_score': 2, 'selected': False, 'text': "<p>Don't forget readability when sending a link, not just in search engines.  If you email someone the first link they can look at the URL and get a general idea of what it is about.  The second one gives no indication of the content of that page before they click.</p>\n"}, {'answer_id': 47520, 'author': 'Kibbee', 'author_id': 1862, 'author_profile': 'https://Stackoverflow.com/users/1862', 'pm_score': 2, 'selected': False, 'text': "<p>If you emailed someone a link wouldn't it make more sense to include a description by actually writing out a description rather than making the other person parse to the URL where the description exists, and try-to-read-a-bunch-of-hyphenated-words-stuck-together.</p>\n"}, {'answer_id': 47527, 'author': 'Kyle Cronin', 'author_id': 658, 'author_profile': 'https://Stackoverflow.com/users/658', 'pm_score': 0, 'selected': False, 'text': '<p>Ideally, the "slug" should be the only identifier needed. In practice, on dynamic sites such as this, you either have to have a unique numerical identifier or start appending/incrementing numbers to the "slug" like Digg does.</p>\n'}, {'answer_id': 47585, 'author': 'billpg', 'author_id': 3568, 'author_profile': 'https://Stackoverflow.com/users/3568', 'pm_score': 3, 'selected': False, 'text': '<p>I note that you can change the text freely. This URL appears to work just as well.</p>\n\n<p><a href="https://stackoverflow.com/questions/47427/why-is-billpg-so-very-awesome"><code>https://stackoverflow.com/questions/47427/why-is-billpg-so-very-awesome</code></a></p>\n'}, {'answer_id': 48048, 'author': 'Alan Storm', 'author_id': 4668, 'author_profile': 'https://Stackoverflow.com/users/4668', 'pm_score': 4, 'selected': False, 'text': "<p>The term slug comes from the newspaper/publishing business.  It's a short title that's used to identify a story in progress.  People interested in URL semantics started using a short, abbreviated title in their URLs.  It also pays off in SEO land, as keywords in URLs add importance to a page.</p>\n\n<p>Ironically, lots of websites have started place a <strong>full</strong> serialized-with-hyphens version of the titles in their URLs for strictly SEO purposes, which means the term slug no longer quite applies. This also rankles semantic purists, as many implementations just tack this serialized version of the title at the end of their URLs.</p>\n"}, {'answer_id': 136457, 'author': 'Andrew Ingram', 'author_id': 15687, 'author_profile': 'https://Stackoverflow.com/users/15687', 'pm_score': 4, 'selected': False, 'text': '<p>It\'s basically a more meaningful location for the resource. Using the ID is perfectly valid but it means more to machines than people.</p>\n\n<p>Strictly speaking the ID shouldn\'t be needed if the slug is unique, you can more easily ensure unique slugs by scoping them inside dates.</p>\n\n<p>ie:</p>\n\n<pre><code>/2008/sept/06/why-some-websites-add-slugs-end-of-urls/\n</code></pre>\n\n<p>Basically this exploits the low likelihood of two identical slugs being in use on the same day. If there is a clash the general convention is to add a counter at the end of the slug but it\'s rare that you ever see these:</p>\n\n<pre><code>/2008/sept/06/why-some-websites-add-slugs-end-of-urls/\n/2008/sept/06/why-some-websites-add-slugs-end-of-urls-1/\n/2008/sept/06/why-some-websites-add-slugs-end-of-urls-2/\n</code></pre>\n\n<p>A lot of slug algorithms also get rid of common words like "the" and "a" to assist in keeping the URL short. This scoped approach also makes it very straightforward to find all resources for a given day, month or year - you simply chop off segments.</p>\n\n<p>Additionally, stackoverflow URLs are bad in the sense that they introduce an additional segment in order to feature the slug, which is a violation of the idea that each segment should represent descending a resource hierarchy.</p>\n'}, {'answer_id': 495292, 'author': 'Alan Doherty', 'author_id': 59995, 'author_profile': 'https://Stackoverflow.com/users/59995', 'pm_score': 2, 'selected': False, 'text': '<p>First off, it\'s SEO and user friendly, but in the case of the example (this site), it\'s not done well or correctly\n(as it is open to black hat tricks and rank poisoning by others, which would reflect badly on this site).</p>\n\n<p>If</p>\n\n<p><a href="https://stackoverflow.com/questions/47427/why-do-some-websites-add-slugs-to-the-end-of-urls"><code>https://stackoverflow.com/questions/47427/why-do-some-websites-add-slugs-to-the-end-of-urls</code></a></p>\n\n<p>has the content, then</p>\n\n<p><a href="https://stackoverflow.com/questions/47427/"><code>https://stackoverflow.com/questions/47427/</code></a></p>\n\n<p>and</p>\n\n<p><a href="https://stackoverflow.com/questions/47427/any-other-bollix"><code>https://stackoverflow.com/questions/47427/any-other-bollix</code></a></p>\n\n<p>should not be duplicates. They should actually automatically detect the link followed is not using the current text (as obviously the slug is defined by the question title and can be later edited) and they should redirect 301 automatically to </p>\n\n<p><a href="https://stackoverflow.com/questions/47427/why-do-some-websites-add-slugs-to-the-end-of-urls"><code>https://stackoverflow.com/questions/47427/why-do-some-websites-add-slugs-to-the-end-of-urls</code></a></p>\n\n<p>thus ensuring the "one piece of content to one URI" rule, and if the URI moves/changes, ensure the old bookmarks follow/move with it through 301 redirects (so intelligent browsers can update the bookmarks).</p>\n'}, {'answer_id': 495329, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 5, 'selected': False, 'text': "<p>I recently changed my website url format from:</p>\n\n<blockquote>\n  <p>www.mywebsite.com/index.asp?view=display&amp;postid=100</p>\n</blockquote>\n\n<p>To</p>\n\n<blockquote>\n  <p>www.mywebsite.com/this-is-the-title-of-the-post</p>\n</blockquote>\n\n<p>and noticed that click through rates to article increased about 300% after the change. It certainly helps the user decide if what they're thinking of clicking on is relevant, in terms of SEO purposes though I have to say I've seen little impact after the change</p>\n"}, {'answer_id': 752718, 'author': 'Cory R. King', 'author_id': 16742, 'author_profile': 'https://Stackoverflow.com/users/16742', 'pm_score': 5, 'selected': False, 'text': '<p>I agree with other responses that any mis-typed slug should 301-redirect to the proper form.  In other words, <a href="https://stackoverflow.com/questions/47427/wh"><code>https://stackoverflow.com/questions/47427/wh</code></a> should redirect to <a href="https://stackoverflow.com/questions/47427/why-do-some-websites-add-slugs-to-the-end-of-urls"><code>https://stackoverflow.com/questions/47427/why-do-some-websites-add-slugs-to-the-end-of-urls</code></a> .  It has one other benefit that hasn\'t been mentioned--if you do not do a redirect to a canonical URL, it will appear that you have a near-infinite number of duplicate pages.  Google hates duplicate content.</p>\n\n<p>That said, you should really only care about the content ID and allow any input for the slug as long as you redirect.  Why?</p>\n\n<p><a href="https://stackoverflow.com/questions/47427/why-do-some-"><code>https://stackoverflow.com/questions/47427/why-do-some-</code></a>websites-add-slugs-to-the-end-of-urls</p>\n\n<p>... Oops, the mail software cut off the end of the URL!  No problem though because you still can roll with just <a href="https://stackoverflow.com/questions/47427"><code>https://stackoverflow.com/questions/47427</code></a></p>\n\n<p>The one <em>big</em> problem with this approach is if you derive the slug from the title of your content, how are you going to deal with non-ASCII, UTF-8 titles?</p>\n'}, {'answer_id': 2838248, 'author': 'Robs', 'author_id': 78077, 'author_profile': 'https://Stackoverflow.com/users/78077', 'pm_score': 3, 'selected': False, 'text': '<p>As already stated, the \'slug\' helps people and the search engines...</p>\n\n<p>Something worth noticing, is that in the source of the page there is a <a href="http://googlewebmastercentral.blogspot.com/2009/02/specify-your-canonical.html" rel="noreferrer">canonical url</a></p>\n\n<p>This stops the page from being index multiple times.</p>\n\n<p>Example:</p>\n\n<pre><code>&lt;link rel="canonical" href="http://stackoverflow.com/questions/47427/why-do-some-websites-add-slugs-to-the-end-of-urls"&gt;\n</code></pre>\n'}]
['https://Stackoverflow.com/questions/47427', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3171/']