Forum Moderators: Robert Charlton & goodroi

Message Too Old, No Replies

Should I switch to hyphens in URL?

         

NickMNS

1:39 pm on Sep 4, 2024 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I discovered this morning that Google doesn't recommend using underscores in URL's. Nearly all my URLs have underscores.
Consider using hyphens to separate words in your URLs, as it helps users and search engines identify concepts in the URL more easily. We recommend that you use hyphens (-) instead of underscores (_) in your URLs.

source: [developers.google.com...]

I use underscore to replace white spaces in names, often names of places. The names of these places often include hyphens, so the use of underscores seemed liked the logical choice in terms of readability, making it possible for the user to differentiate between space and hyphens.

Do you think it is worth the hassle of updating all the URLs and then managing all the redirects? Will this make a noticeable difference in terms of ranking?

not2easy

2:21 pm on Sep 4, 2024 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Underscores have long been an issue for Google when used in URLs. The underscore is considered a letter while hyphens are seen as a space, a separator/connector of words. That might have been influenced back in their start-up days when CSS didn't exist and default styling filled in for unassigned elements (like all links being blue underlines that could hide underscores). Google has long stated that URLs should use hyphens. The earliest reference around here to the hyphen/underscore question goes back to 2002:
Hyphen or Underscore? [webmasterworld.com...]

Note - there may be older threads and there are several newer threads, but I quit reading after the first page of the topic. Yes, it would be an enormous amount of work to make those changes, and no guarantee that it makes an enormous difference - but it could help. A 2007 post quotes "Underscores Are NOT The Same As Dashes," says Matt Cutts
[webmasterworld.com...] (2007)

NickMNS

2:58 pm on Sep 4, 2024 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



The quote from 2007 pretty much answers the question.
if you’d already made your site with underscores, it probably wasn’t worth trying to migrate all your urls over to dashes. If you’re starting fresh, I’d still pick dashes.


The issue isn't the work involved, it would actually be pretty straight forward, simply changing a "_" to "-" in a few replaceAll() calls, and setting up a filter to catch and redirect the old URLs. The real problem is that this will add to redirects that are already in place, creating a nasty soup of redirection. This would likely cause a bigger mess that would certainly offset any potential benefit.

lucy24

3:11 pm on Sep 4, 2024 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Note too that in the originally quoted G utterance, all they said was “consider”. Not You Must, not We Strongly Recommend, just a simple “consider”.

Personally I think multiple hyphens in a hostname make the site look trashy, while multiple hyphens in an URLpath scream out “I am the creation of a CMS”. If you’re doing it yourself, another option is CamelCase, though others may react badly to Capital Letters. (But take my opinions with a shovelful of salt. To this day, my reaction to an extensionless URL is “Go back in the server and put some clothes on!”)

And, finally: You’re talking about URLs, right, not <title> or <h1>. How many humans even look at the URL itself?

Marshall

12:21 pm on Sep 5, 2024 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Hyphens make more sense to me for the mere fact people do not hit the shift key when they type nowadays and an underscore requires that you do whereas a hyphen does not.

RedBar

1:03 pm on Sep 5, 2024 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



people do not hit the shift key when they type nowadays

They do on all our mobiles and some of our sites have 75% mobile visitors.

Kendo

1:27 pm on Sep 5, 2024 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I recall that Google recommended hyphens for improved SEO. But I saw that as typical misinformation because here is no no excuse for treating them differently. Changing standards to hide shortcomings is very boring when we see so much of it.

I have always used underscores and still do because the hyperlinks are easier to read... underscores look more like spaces than hyphens.

lucy24

4:05 pm on Sep 5, 2024 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



people do not hit the shift key when they type
But that’s begging the question, isn’t it. How many visitors get to a site by typing in the entire URL, as opposed to (a) clicking a link or (b) selecting a bookmark? (In my case it tends to be (c), type the first few letters and see what the browser offers from its history.)

Edge

11:44 pm on Sep 5, 2024 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



There's no evidence google cares for the serp results..

"Consider using hyphens to separate words in your URLs, as it helps users and search engines identify concepts in the URL more easily. We recommend that you use hyphens (-) instead of underscores (_) in your URLs.".

It's about users and search results

lucy24

2:33 am on Sep 6, 2024 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



There's no evidence google cares for the serp results.
This seems a little cryptic, since SERP results* are G's own creation.


* A phrase to put alongside “PIN number” or “ATM machine”.

londrum

5:26 pm on Sep 6, 2024 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



If i was going to make that change then I would just do it for new pages. I wouldn't mess with any existing URLs.
If you notice a big difference with the new ones then maybe go back and change the old ones later

EditorialGuy

4:28 pm on Sep 7, 2024 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Some of our oldest pages (which have underscores in the URLs) are also among our best-performing pages, so I'm inclined to think that londrum's advice is spot on.

lucy24

6:47 pm on Sep 7, 2024 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



File under: If it ain’t broke, don’t fix it. (Obviously not a universal rule, as it implies there are only two possible states, broke and not-broke, but does seem to apply here.)

tangor

9:32 am on Sep 8, 2024 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Years ago switched to hyphens .... but have always avoided changing EXISTING urls (older stuff) if it can be avoided. Ain't broke, just different from the rest of the site. As to whether it makes a real difference as far as g is concerned, that has not been my experience.

Wilburforce

5:13 pm on Sep 8, 2024 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Echoing earlier posts (in particular Edge and not2easy), using hyphens is better practice than using underscores, as - among other things - it "helps users and search engines identify concepts in the URL more easily".

As far as SEs are concerned, https://www.example.com/important-concept.htm contains the words Important and Concept, while https://www.example.com/important_concept.htm doesn't contain any words at all: important_concept isn't a word, it's just a string of characters*. How much weight attaches to the words in the URL is obviously debatable, but if you want SE's to take account of the words in the URL, don't use underscores.

The obvious place to start is with new pages, but being consistent is good practice too: having a mixture of pages, some with underscores and some with hyphens, doesn't improve the UX or overall impression. However, if changing all existing pages is a Mammoth Task, I'd file it under Things to do if I Get Time. It IS broke, but not badly enough to interrupt the journey, let alone cancel your holiday.

As for Using-the-Shift-Key, I don't remember the last time I manually entered a URL in the address bar, but I'm sure it had a colon in it.

*Possibly this isn't one of AI's top priorities either.

NickMNS

2:59 am on Sep 10, 2024 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



The obvious place to start is with new pages,

If i was going to make that change then I would just do it for new pages.

For the record, in my specific case I cannot make the change to new pages only, as the URL's are generated by a custom built CMS. Moreover, the concept of "new pages" doesn't really apply in this case as pages are updated in a continuous cycle. The result would be a mess of both hyphenated and underscored URLs.

I'm not changing anything. There is enough content on the page that Googlebot should be able to figure out what the event name is underscored or not. (H1 tag, title tag, schema markup).

Kendo

11:45 am on Sep 13, 2024 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



using hyphens is better practice than using underscores, as - among other things - it "helps users and search engines identify concepts in the URL more easily

To me "important_concept" looks like 2 words and "important-concept" looks like one word. The underscore highlights that. Let me ask this... is "anti-aircraft" one or two words?

How anyone can say otherwise beats me. Or is misinformation to be believed simply because a billion dollar company pumps it out?

EditorialGuy

3:20 pm on Sep 13, 2024 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



@Kendo: You're tilting at windmills. If you want traffic from Google, isn't it wise to listen when Google explains how it interprets "word-word" vs. "word_word?"

I can't help thinking of a song title: "I Fought the Law, and the Law Won."

Wilburforce

10:32 pm on Sep 13, 2024 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Or is misinformation to be believed simply because a billion dollar company pumps it out?


I didn't hear anyone say anti-aircraft isn't a word: the hyphen in that case is there for readability (antibacterial doesn't need one, but antiaircraft?).

"Family-run-business" is another matter, as is https://www.example.com/widgets-for-seo.htm. The purpose of a hyphen is context-based (see e.g. "Eats, Shoots and Leaves: The Zero Tolerance Approach to Punctuation", by Lynne Truss).

Google isn't telling you to use hyphens in URLs: it's telling you a text-based search will read word1-word2 better than it reads word1_word2. Bing says "Hyphens are the preferred character for separating two words in URLs". That's useful advice, not a conspiracy.

Kendo

2:47 am on Sep 15, 2024 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



it's telling you a text-based search will read word1-word2 better than it reads word1_word2.

If that is the best that their programmers can do, it doesn't say much for anything else that they have developed.

Wilburforce

9:46 am on Sep 15, 2024 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



the best that their programmers can do


...is work with probability. It is more likely that a hyphen is part of a word or group of connected words than that an underscore is.

What is obvious from one perspective may be less so from another. Humans don't do too well at seeing an underscore in an underlined link.

chewy

10:38 pm on Sep 28, 2024 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



There's more than one easy test. Pick your favorite key phrase. Search on it using a space, a hyphen and an underscore.

Pretty sure I did this decades ago and the answer was what everyone is repeating. One is commonly used in English - the other not-so-much.

Today, I thing you will see that Google can figure this out. Not sure of the rest of the bunch, but the test is easy enough.