Underscores vs. Dashes

Spaces should never be used in a URL or file names because the space character gets translated to “%20″ by the browser, and this can wreak havoc with both readability and statistics or analytics programs. The question then remains, which is better to use instead of spaces, underscores “_” or dashes “-“.

As far as Google is concerned Big_Oak consists of one word, “Big_Oak”, and Big-Oak consists of two words, “Big” and “Oak”.

The reason Google does not treat the underscore as a word separator is because Google was created by programmers who knew that programmers often wanted to search about programming. Many computer programming languages use the underscore character in such ways that CLASS is different from _CLASS.

Because of this, I always recommend using dashes instead of underscores in your filenames and URLs. Be careful not to use too many dashes in your domain name, as that could get your site flagged for other reasons. I prefer to have a domain name with no dashes, and to use dashes where appropriate in the directory and file structure.

Example URL:

http://www.bigoakinc.com/blog/category/52-seo-strategies/

Other things about Google to keep in mind when choosing filenames and URL structure.

There is no difference between lower-case and upper-case:big oak, Big Oak, BIG OAK, and biG Oak are all the same.

The ampersand “&” is a word seperator:Big&Oak is treated as two words.

Singular words are not the same as plural words:oak and oaks are treated as different words.

Google cannot read words that are within other words:bubble will not be seen inside of bubblegum.

As with any tip, keep in mind that it’s a combination of many factors which will ultimately decide your placement in the search engine rankings and quite often every little bit counts.

Chris, you mention that too many hyphens are not a good thing, and I agree. Most blog posts, including mine, have several hyphens but the search engines seem to still index and find the pages. Do you think there is any harm in blog URLs including hyphens?

Steven,
I wouldn’t worry about the number of hyphens in the blog post title or file names. I was warning against registering a domain name with too many hyphens. For example, making your domain name something like search-engine-optimization-seo-website-design-application-development-services.com is probably a very bad idea in many ways.

Using a single hyphen or even a couple hyphens in a domain name is perfectly fine. If you have a domain name with 5 or more hyphens, then you could run into not only SEO problems, but usability problems as well.

Internet marketing is indeed very different from traditional marketing. In the field of internet marketing the webmaster uses all possible means for promotion just from the comfort of his small office or his bedroom.

Hey this was really handy to know – my page titles are created automatically with ‘-‘ in wordpress and some of them are pretty long.. is there a rule of thumb to use about the number of dashes in a webpage name (concerned about your comment that you should not have too many dashes).

I have a cartoon site and the names of the cartoon image files also contain dashes – I surfed a bit through your site but could not find any articles as to how to best optimise for these cartoon files for indexing under google images – it seems pretty random how things are getting into the index even though the naming conventions/ alt tags/ title tags etc are all handled consistently on the site! Any suggestions would be much much appreciated!

Having devoted considerable time to this question during my career, particularly in recent years, I can only conclude that dashes are not the best delimiter. Moreover, I believe a consensus will emerge eventually with an alternative character being used universally — probably the underscore:-