What is the ideal length of an URL slug

Sinan picture Sinan · May 27, 2010 · Viewed 9.3k times · Source

To make pretty URL's from article titles I am using a simple function. However lately I an concerned about the ideal length of these "slugs". It is said that too many dashes are bad.

However some article titles can be long and a too long URL may not be liked by google. Of course that defeats th whole idea of having URL slugs.

So does anyone have any idea how long a URL slug should be. Should there be a limit on the "dash" charecters used?

Answer

Timo Westkämper picture Timo Westkämper · May 30, 2010

If you really want to be economic with URL space, I'd remove articles (the, a, an etc.) more aggressively than prepositions and verbs since removed articles don't change the semantics of the sentence that much.

e.g.

What is the ideal length of an URL slug

remove articles

What is ideal length of URL slug

remove "What is"

ideal length of URL slug

normalization

ideal-length-of-url-slug