Gary Illyes from Google reiterated that it is still best for SEO purposes to use hyphens as separators in your URLs over using underscores are separators in your URLs. Why? Gary explained “we can’t easily segment at underscore and that’s why we are recommending dashes.”
This came up in the latest Search Off The Record podcast at the 17 minute mark or so where Martin Splitt mentioned “That’s why brevity for me is important as well. Yes, sure, you can use a URL shortener, but then you get links, like, I don’t know, something.something/8907d12. And I’m like, yeah, that’s not easy to remember at all. But if it’s like “mobile-friendly-test” and I can remember that. But if it’s “mobile_friendly-test” or something like that. And it’s like “ugh!” But Gary, you said there’s a difference.”
Gary responded saying “There’s a difference and that’s in our segmenter. Basically we use some parts of the URL for understanding what the page is about. And the way it works is that we need to be careful about where we are segmenting because many things on the internet, things that people write about have an underscore in them, so we can’t easily segment at underscore and that’s why we are recommending dashes.”
Here is the embed:
Now, there is a ton of history here on underscores versus hyphens in URLs and what Google has said about them before. In 2007, Matt Cutts of Google told us to use hyphens / dashes over underscores and clarified that he did not say that Google treated them equally. He did in 2017 say he want Google to treat underscores as separators but didn’t seem successful back then. In 2016, John Mueller said underscores vs. dashes doesn’t matter.
So I guess it still does matter, as this is the latest information from Google – that hyphens/dashes are still recommended over underscores for word separators in URLs.
One big caveat – I would not change established URLs just to add hyphens – that would be a horrible idea.
Forum discussion at Twitter.