Pablo Fernandez
Pablo Fernandez

Reputation: 287860

What's the best character to represent blank spaces in a URL?

When you are building URLs that should be legible for users and search engines and you do it automatically from the content, what's the best way to represent blank spaces? Hyphens (this is what StackOverflow uses)? Underscores? Any other? Does any of those make a different for SEO?

Upvotes: 9

Views: 6229

Answers (7)

Iakovos Georgiou
Iakovos Georgiou

Reputation: 11

This may answer your question. Things looks like changed for Google few years ago about - and _ See this article here: http://www.blog-tutorials.com/marketing-and-seo/linking/google-oks-underscores-as-word-separators-in-urls-and-more-seo-tips/

Upvotes: 1

Ludwig Weinzierl
Ludwig Weinzierl

Reputation: 16614

Both are valid URL characters and both have their pros and cons.

Pro dash

  • Google recommends dashes, and here is what Matt Cutts from Google has to say about Dashes vs. underscores.

    If you have a url like word1-word2, that page can be returned for the searches word1, word2, and even “word1 word2″. That’s why I would always choose dashes instead of underscores.

  • Dashes seem to be what major blogs do: The Huffington Post, TechCrunch, Engadget, ...
  • Dashes seem to be what major CMS do.
    Not sure about that one anymore, can anyone comment?
  • As mentioned by Kazar, underscores can clash with the underlining of links.
  • I find underscores awkward to type.
  • Rene Saarsoo pointed out that dashes take less space than underscores in proportional fonts.
  • Ionut G. Stan mentioned that underscores are not allowed in hostnames. If you strive for consistency you should opt for dashes.

Pro underscore

  • Dashes are not allowed in ISO9660 file systems. This can be a problem if your content is also shipped on DVD or CD (e.g help files or eLearning content).
  • In some languages (e.g. German) dashes can be word characters and are not generally considered word separators.

Upvotes: 24

Rene Saarsoo
Rene Saarsoo

Reputation: 13937

Another advantage of dashes is that in proportional font they take less space that underscores. Compare:

It's not a lot, but every little helps :)

Upvotes: 8

Ionuț G. Stan
Ionuț G. Stan

Reputation: 179219

You know, if you buy a domain name, you're allowed to use hyphens inside that name, but no underscores. This is an additional reason for which I believe hyphens are better than underscores.

Upvotes: 4

Rook
Rook

Reputation: 62588

I'd say dashes. I used to use underscored for pretty much every such purpose (representing spaces) but nowadays, with all the visual thingies blinking all round, you often find underlining that makes them normally invisible.

Upvotes: 1

Alistair Evans
Alistair Evans

Reputation: 36513

Again, personal preference - personally I think hyphens work better than underscores, because underscores can clash with the underlining a tags add (by default), so http://someurl.com/this_is_a_address looks like there are no underscores there. (as this is stack overflow, roll over the link). http://someurl.com/this-is-a-address looks fine.

Upvotes: 7

schnaader
schnaader

Reputation: 49731

I think that depends on your favorite. My favourites are underscores, but I don't see any (dis-)advantages if using hyphens or other valid URL characters instead. And everything looks better than %20 :)

Upvotes: 0

Related Questions