71

Possible Duplicate:
What is the etymology of 'slug'?

In CouchDB definitive guide the author used key "slug" in a document.

{
   "title": "Hello World",
   "slug": "hello_world"
}

What does "slug" mean and why is it used?

Community
  • 1
  • 1
ajsie
  • 77,632
  • 106
  • 276
  • 381
  • 2
    See [What is the etymology of 'slug'?](http://stackoverflow.com/questions/4230846/what-is-the-etymology-of-slug). The answers explain both the etymology and meaning. – Matthew Flaschen Dec 05 '10 at 02:21
  • https://en.wikipedia.org/wiki/Clean_URL#Slug – Brent Bradburn Mar 22 '21 at 01:44
  • This is a question that programmers will want answered. The "Possible Duplicate" is closed too. – Brent Bradburn Mar 22 '21 at 01:46
  • 1
    We love closing questions around here @BrentBradburn - I think there's some financial incentive for admins - 2c per closed question if it remains closed for at least 6 months, something like that. – NeilG Mar 03 '22 at 06:53

1 Answers1

67

A slug is an alternative to a name that would otherwise not be acceptable for various reasons - e.g. containing special characters, too long, mixed-case, etc. - appropriate for the target usage. What target usage means is context dependent, but could include usage in a URL or name of a file or database table for example. In the general case a slug may be composed from a combination of multiple fields; in the above case, only one field is used - title.

Have a look at these SOqs, too:

If you are into the origin of the term, see this:

Alexander Taylor
  • 16,574
  • 14
  • 62
  • 83
icyrock.com
  • 27,952
  • 4
  • 66
  • 85