Your Url containing dashes or underscores? Here’s what to do

Site Audit Issues
Like
Comments
Share
Your Url containing dashes or underscores? Here’s what to do

If you think that Google doesn’t care if you use a dash or underscore in your URL, you aren’t right. Google has preferences when it comes to structuring your URL. And yes, it affects SEO. Interested how? Read our blog post to learn more about the differences between url, hyphen, underscore, and em dash and when to use them.

Does the use of dashes or an underscore in the URL play a detrimental role in your site’s SEO?

Let’s start with why URL structure matters and how it affects rankings. First and foremost, URL structure matters not only for search engines but for your users as well. A well-crafted, structured URL tells users what your page is about and what they can expect to get after clicking it. Unorganized URLs with random words or numbers look shady and don’t build trust with your brand.

Google also analyzes URLs to find out if the page content is relevant to the search query. However, URLs by themselves do not directly influence your rankings, so while including a keyword in your URL is a good practice, don’t overdo it. By the way, Google has a detailed guide on how to create and organize URLs, so make sure to read it.

According to the documentation we’ve sent above, Google recommends using hyphens instead of underscores when creating user and SEO-friendly URLs for your website. Moreover, Google says that using underscores is a bad practice.

What is a URL?

A URL was created as an alternative for the numbers in IP addresses used by computers to communicate with servers and identify the website’s file structure. URL consists of a protocol, domain name, and path.

What is the main URL purpose? First of all, it provides your browser with specific instructions on what page to find on the Internet. When the browser gets this instruction, it sends a request to a web server at that address, and a server returns a result. This is a core rule of Internet browsing.

What Is a Hyphen?

Hyphen is a punctuation mark used to join words and to separate syllables of a single word. Hyphens make URLs more readable and comprehensible for both users and search engines. Simply speaking, hyphens isolate words in your URL and help users understand what the page will be about at first glance.

What Is the En Dash?

An en dash (–) is a midsize dash (longer than a hyphen but shorter than an em dash) that is mostly used to show ranges in numbers and dates. Google recommends using hyphens to separate words in your URLs, as it helps users and search engines identify concepts in the URL more easily.

What Is the Em Dash?

An em dash in url is a punctuation mark that can replace commas, parentheses, colons, and semicolons. The em dash resembles a horizontal line (—) that is longer than both a hyphen (-) and an en dash (–) and is usually used to draw attention to some word or phrase.

When it comes to URLs, Google restrains you from using em dashes in urls structure as well.

What Is an url underscore?

An underscore or underline is a line drawn under a segment of text and is used as an emphasis. Underscore url is not recommended, as Google will not recognize it as a separator. For example, a URL with dash in the phrase "my_shop" would be interpreted as "myshop" instead of "my shop".

Does Google Have a Preference?

Dash vs underscore, what is better? As we have already mentioned, yes. Google does have preferences when it comes to using punctuation marks in your URLs. The point is that Google doesn’t recognize some punctuation mark, so it will misinterpret its meaning. That’s why it’s recommended to use only hyphens when it comes to URL structure. Also, remember that you create not for Google, you create for people. Are underscores allowed in urls? No. That’s why you should make your URLs simple, readable, and relevant for users.

Boosting Your Site’s SEO

Here are the best practices for creating URLs that both website users and Google love.

  • Keep your URLs simple and relevant

This is actually the key rule when it comes to creating URLs. It’s no longer a secret that Google analyzes user experience signals to determine if people are engaging with your website. That’s why if you use long, not relevant URL, it will definitely influence your organic CTR, causing your website to rank lower in search engine results.

  • Avoid using dynamic parameters

If you shorten your links for social media sharing, your URL may have dynamic parameters used for tracking clicks. Though they are not a real threat, however, sometimes, they may result in long URLs.

  • Match URLs to titles and use a keyword in your URL

It doesn’t mean your URL should be the same as your title. However, do your best to make the URL a shortened version of your article’s title. Keep one goal in mind: think about the main idea of your page and what the user will find on the page through the URL and then make your headline/title meet users expectations.

Don’t Use Dashes in Domain Names

While it’s not forbidden to use underscore dash in domain names, such practice has more drawbacks then benefits.

  • Domain names with dashes can be harder to remember. Users might forget whether the dash is present or where it's located, leading to potential mistypes.
  • Ease of Sharing: When verbally sharing a domain name, including dashes can make it more complicated. People may forget to mention the dash, or it might be misheard.
  • Perception: Domain names with dashes can sometimes be associated with spammy or less trustworthy websites. This is not a strict rule, but some users might view such domain names with suspicion.
  • SEO Impact: Search engines may treat domain names with underscore and dash differently. While search engines have become more sophisticated in handling different types of domain names, some older algorithms may have difficulties.

Hyphens Are for File Names

Underscore vs hyphen. Hyphens are commonly used in file names for a few reasons:

  • Readability: Hyphens can enhance the readability of file names by providing a clear separation between words. For example, a file named "monthly-report-2024" is easier to read than "monthlyreport2024."
  • Search Engine Optimization (SEO): In web development and content creation, using hyphens in file names and URLs can contribute to better SEO. Search engines like Google often interpret hyphens as space, making it easier for algorithms to understand the meaning of individual words in a file name.
  • Consistency with URLs: When creating web content, file names are often reflected in the corresponding URLs. Using hyphens in filenames helps maintain consistency with the URL structure, contributing to a more user-friendly and SEO-friendly website.
  • Compatibility: Some operating systems and web servers may have restrictions or issues with spaces or special characters in file names. Hyphens are a safe and widely accepted way to separate words in file names without causing problems.

Hyphens vs Underscores

Here are the key differences in using hyphens and underscores in URLs.

  • Readability

Search engines like Google treat hyphens as space, so hyphens make URLs more readable. For example, "my-article-title" is more readable than "my_articletitle."

When it comes to underscores, search engines do not treat them as spaces. While some web servers and browsers can handle underscores in URLs, they might not be as visually clear as hyphens.

  • SEO Considerations

Hyphens are generally recommended for SEO purposes. Search engines interpret hyphens as word separators, which helps algorithms understand the individual words in a URL. This can contribute to better search engine optimization.

Underscores are not treated as word separators by search engines. If you use underscores in a URL, the entire string between underscores is considered a single word.

  • Compatibility

Hyphens are widely supported and accepted in URLs across various web platforms, servers, and browsers.

Underscores are generally supported. Some older systems or applications, however, may not handle them well. In certain contexts, underscores might lead to issues, so it's better and safer to use hyphens.

Using a Dash or an Underscore in Urls: What You Need to Know

It’s better to avoid using dashes and underscores in your URL as Google does not recognize them. As a result, search engines will consider the entire string between underscores a single word. This can potentially impact SEO.

How to Find URL Issues with Netpeak Spider

Netpeak Spider

With Netpeak Spider, you can easily detect and fix different URL issues: from broken links to improper URL structure. Here is how.

In order to add pages for analysis, you can choose the ‘List of URLs’ item in the main menu, where you will find several ways how to enter URLs of web pages:

  • Enter manually → a separate window with text input will be opened for you to add a list of pages. Each URL should be on a new line.
  • Paste from clipboard → the same as Ctrl+V combination to the program main table, list of URLs from clipboard will be added to the table, and a notification with appropriate brief summary information will appear in the bottom right corner.
  • Upload from a file → imports URLs from files with following extensions: .txt, .xlsx (Microsoft Excel), .csv (comma-separated values), .xml, .nspj (Netpeak Spider project) and .ncpj (Netpeak Checker project).
  • Download from XML sitemap → extracts a list of URLs for analysis directly from a sitemap.

Check out the list of different parameters you can test with Netpeak Spider. Also, you can add any custom list of URLs and check it for issues without limiting yourself to one website. Netpeak Spider is a great assistant for performing a wide range of different tasks regarding on-page optimization analysis.

Conclusion

Always remember about the golden rule - make URLs human-centric; don’t create them for machines. Google understands what users are searching for and gives additional juices to those websites that meet people's needs. That’s why regularly check your URLs for different errors and optimize them for both Google and users.