• Skip to primary navigation
  • Skip to main content
  • Skip to footer

WPJohnny

WordPress Performance Guides and Reviews

  • Start a WordPress site
  • Hosting
  • Themes
  • Plugins
  • Blogging
  • Marketing

UNDERSCORE vs HYPHEN (in text strings)

WordPress hosting Jun 6, 2020 by Johnny 4 Comments

Today’s tech PSA so clients don’t make me want to jump out the window.

There are many explanations about whether to UNDERSCORES “_” vs HYPHENS “-” in your day to day technical tasks.

  • SEO consultants say hyphens are better because it clearly separates words in search engines. (e.g. fancy-cars is read as “fancy cars”, and fancy_cars is read as “fancycars”)
  • Python programmers say underscores are better (something_1.py vs something-1.py) because the hyphen means something else in Python.
  • UI experts say hyphens look better because your eyes are constantly pulled to the bottom of the string.
  • Usability experts say hyphens are easier since you don’t have to hold down the SHIFT key to type them.

I don’t care about any of those explanations. My only gripe is about its copy-paste computer usability.

UNDERSCORES copy-paste easier than HYPHENS

See for yourself. Try double-clicking the follow strings:

  • underscores_are_the_best
  • hyphens-suck
  • See_how_easy_this_is
  • See-how-annoying-this-is
  • Periods.and#other?punctuation.suck.too!

Do you get my point? See…I touching anywhere from 10-20 websites or web servers per day. And it annoys the hell out of me to see filename and usernames using hyphens.

Unless you need a hyphen for readability or SEO purposes, you should always use underscore for everything that you do!

Please be kind to your developer. Make it easy for them to copy-paste text strings back and forth. You’re making the world a better place. THANK YOU!

Share this post:

Share on FacebookShare on X (Twitter)Share on LinkedInShare on WhatsAppShare on EmailShare on SMS

Read all my posts on WordPress hosting

About Johnny

Right on the edge of WordPress development! 10+ years of WordPress design, development, hosting, speed optimization, product advisor, marketing, monetization. I do all that.

More WordPress Guides

Totally biased review of FlyingPress cache plugin

CyberPanel server commands and important directories

How to get BEST PRICING on a Apple MacBook Pro

Why LiteSpeed Cache is the #1 cache plugin for me

Breakdance – WordPress sitebuilder review

Affinity design software review

Reader Interactions

4 Comments

  1. Regev Elya

    June 8, 2020 at 8:56 am

    Amen.

    Reply
  2. Dimiter Kirov

    June 9, 2020 at 7:18 am

    Well, I use hyphens in the images file names. For SEO purposes , Johhnny. Images are included in my sitemap. And they do bring organic traffic.
    Also I use hyphens in the posts’ slugs . Because of the same reason. They contain keywords.

    Reply
    • Johnny

      June 9, 2020 at 11:03 am

      Yes…that’s good practice. Hyphens in frontend assets.

      Reply
  3. Mark

    July 27, 2020 at 4:28 pm

    I use both in file names.

    Underscores_to_separate_base-2020-07-27.ext

    Now I can quickly select just a part to modify if needed.

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Footer

More links

  • Gadget reviews
  • Try my free WPJ plugins
  • Join the WPJ FB Group
  • WPJ YouTube & newsletter
  • Become a WPJ Affiliate

Popular Reviews

  • Best WordPress Hosting
  • Best WordPress Themes
  • Best WordPress Plugins
  • Best WordPress Cache Plugins

Services

  • Speed optimization
  • Speed optimization courses
  • WordPress hosting
  • Hire me or other experts
  • Client login

About Johnny

10+ years of WordPress design, development, hosting, speed optimization, marketing.
Contact me.

newsletter block

Copyright 2025 | WordPress guides by Johnny Nguyen

Click to Copy