Should I Use Dashes Or Underscores?

Article By:
Should I Use Dashes Or Underscores?

When deciding on a naming convention for pages on your site one might assume with good reason that dashes and underscores are equivalent. That is to say that soft_drinks/grape_soda and soft-drinks/grape-soda are viewed the same by Google. This is actually not the case, Google views these pages differently.

The reason for this is one of programming convention. When naming variables and functions in most programming languages, underscores are one of the few allowed characters, whereas dashes usually are not. In the early days of Google, it was a serious concern that programmers be able to search based on variable or function names and find what they were looking for with accuracy, so underscores were given special treatment.

Google views underscores as a character that continues a word, like any alphanumeric character; whereas dashes are a separator like space. That is to say that Google will treat “soft_drinks” as one single entity but “soft-drinks” as two (‘soft’ and ‘drinks’.) In most cases this alone isn’t going to have a ton of impact on your page rankings, but if you are designing a new site from scratch, Google recommends using dashes instead of underscores.

But if your site is already up and running with underscores in place, it’s probably not a big deal. Just because the page is stored as “grape_soda” doesn’t mean it won’t hit on a search for “grape” or a search for “soda” or even a search for “grape soda”. It will still hit it, but just won’t benefit as much for the page name if it were named “grape-soda”.

Web Designer / Developer

We use cookies to personalize the website for you and to analyze the use of our website. You consent to this by clicking on "I consent" or by continuing your use of this website. For more information about cookies, see our Privacy Policy.