Underscores vs. dashes in URLs
Why Webmasters Stack Exchange recommends it
Webmasters Stack Exchange answerers point people to it as the authoritative statement from Google that hyphens, not underscores, should separate words in URLs.
Recommended by 3 people across 3 different months, 2010 to 2019.
Why Stack Overflow recommends it
Stack Overflow users link it as a citable source when answering whether URLs should use dashes or underscores for SEO-friendly slugs.
Recommended by 0 people across 0 different months, 2012 to 2017.
What it is
A short 2011 Google Webmaster Help video in which Google engineer Matt Cutts explains how Google treats underscores and dashes in URLs. Dashes are read as word separators, while underscores join the words around them.
What people said
Recommends Simon Hayter · 2013-11 · Webmasters Stack Exchange · on “On which page(s) to add canonical?”
You should normally always opt to use dash vs underscores in URL's due to the fact that Google treats dash as a true word separator, through technically Google can make sense of both. Matt Cutts explains the difference between how Google interprets underscores and dashes [this video] in a URL.
Recommends JohnB · 2015-05 · Webmasters Stack Exchange · on “URLs: Should I use hyphens, underscores or plus symbols?”
Good video about it from a Google engineer: [this video] *(Matt Cutts was also mentioned in the accepted answer below)*
Recommends Tariq · 2019-07 · Webmasters Stack Exchange · on “With respect to SEO, is it preferred to use hyphen instead of period in the URL?”
Well its not about domains containing underscores, its for topic indexing, like wordpress use post title as url/slug with every word separated with a hypen. Yes.. Yellow_Cab will mean yellowcab and yellow-cab will mean 'yellow cab'. Here is a video from Google webmasters where matt answers the question about hyphen v/s underscore [this video] do have a look
Cites JasonBirch · 2010-07 · Webmasters Stack Exchange · on “URLs: Should I use hyphens, underscores or plus symbols?”
Although there seems to be less difference now than there was in the past, hyphens are recommended if you want each of the terms in your URL recognized as an individual word. The reason for this is that search engines find it easier to treat hyphens as word separators, just as they are in the English language. Underscores, however, are not normally used in English as word separators. In many cases it is desirable to see them as part of the characters before and after them, for instance when underscores are used in function names for programming, and other similar situations. There are a couple cases where this might matter. For one, if someone uses the full URL as the anchor text for a link,
Cites Mike Hudson · 2011-09 · Webmasters Stack Exchange · on “Can people's names be added to a URL slug?”
You're over-valuing the " keyword in the url [LINK] " impact for SEO purposes. Yes, all other things being equal having keyword may assist (they'll be useful to your visitors). Don't use underscores in URLs. Just don't [this video] . Don't use commas in URLs. Just don't [LINK] . Hypenating the URL with -2 is much better. Length of the URL is also not a radically large factor - except when you're differentiating 30 characters vs 230...
Cites Su' · 2012-03 · Webmasters Stack Exchange · on “URLs - Hyphens or keywords?”
-1 The question isn't really about (debatable) clarity of intent but search engines. Your recommendation directly contradicts the known behavior [this video] of the leading engine. To your points: 1> In a URL, a dash is a character, not punctuation. 2> This makes no sense. When have you ever seen a dash replace a directory separator, unless intended to specify an entirely different URL? 3> Hyphens are perfectly valid in URLs; handling that with a proper regex is the implementor's responsibility.
Cites David K. · 2012-04 · Webmasters Stack Exchange · on “Is it better to use slash or hyphens for SEO”
General rule of thumb is, the closer you are to your root domain, the better. It is said, that Google weights subfolders in descending order. For example: [LINK] 2 .1 /3 /4 /5 5 That basically means, that your domain gets the highest rankingpower for its word(s), followed by the subdomain (if any), then position 3, 4, 5, etc. And as Matt Cutts (from Google) stated (and recommends as a best practice): Google treats hyphens in URLs as a word separator [this video] , which basically says this: [LINK] 2 .1 /3 3 3 3 This allows all four words in your URL to score the same rankpower for each keyword: card 3, wow 3, 20 3, euros 3 instead of card 3, wow 4, 20 5, euros 5.
Cites GDVS · 2012-09 · Webmasters Stack Exchange · on “Which URL is SEO friendly?”
@rzon You're right, john-smith is better, in the sense that it separates the two words, "john" and "smith". This video from Google, though it's talking about the relative merits of underscores and hyphens as word separators in URLs, confirms that Google interprets a hyphen in such a way as to treat the two words separately, which is important since "johnsmith" is a nonsense word, whereas "john smith" is not. [this video]
Cites simonmenke · 2012-10 · Stack Overflow · on “Make search URL search engine friendly: hash -> what?”
don't use _ (underscore) to delimit words. Google interprets [this video] hello_world as one word but hello-world as two words. don't put your human readable keywords in the query string (after the ? ). Instead make it a normal URL [LINK] (SAO)-para-Recife-(REC) I would go for a something like: [LINK] (SAO)-para-Recife-(REC)
Cites user2177336 · 2013-08 · Stack Overflow · on “Apache roller url rewriting”
Hi, Thanks for your answer. I agree that underscores are more pleasing sadly google doesn't view them as word separators (see this video: [this video] ) although it doesn't have that much of an impact when you have a fairly new site small details like this counts.