Hello, my name is Manuel and I used to be a cowboy coder. Even though cowboy coding is wrong, I used to do it a lot, especially when I was short on time. But I gave up this nasty habit — and you can too!

What is cowboy coding?

First, let’s get one thing straight. Everyone who has ever made any changes to a website has done some cowboy coding at one time or another. Even if you don’t think you have — believe me, you have. To reiterate this point, let’s talk concepts.

According to Wikipedia, cowboy coding is:

Software development where programmers have autonomy over the development process. This includes control of the project’s schedule, languages, algorithms, tools, frameworks and coding style.

To us WordPress fans, a more usable way of looking at it is: any change you make directly on your live site, without doing a controlled test first.

See, I told you you’d done it.

But I’m not really cowboy coding, am I?

To make things even more clear, let’s paint a picture. Tell me if you feel familiar with the landscape.

  • You think the File Editor on the “Dashboard/Appearance” link is a godsend. You constantly use it whenever you need to edit the code on your theme or on a plugin. You figure that if it was really dangerous, the WordPress guys would never have put it there.
  • You think using code generators is a safe way to write code that won’t break your site. So testing this code is a unnecessary waste of time.
  • You like doing live changes, because it’s faster and more efficient than testing on a staging site. Besides, if something breaks, you’re sure to notice it right away, and you’ll fix it before anyone sees it.
  • You buy themes that have thousands of settings, so you won’t need a developer to make every single change for you. And the themes that have an “insert custom code here” setting are the best ones in your book.
  • You think testing is for real software development. WordPress is just a blog platform with a simple-to-use interface. There is no need for that many formalities.
  • You always click on the “update” button whenever a new version of WordPress comes out. Same with the themes and the plugins. It’s safe, and that’s how everyone does it, right?

If you answered yes to any of the previous statements, then you are a hardcore cowboy coder. You need to quit before something really bad happens to your site. And trust me, it will happen.

Even if you are not touching the code, clicking on those “update now” buttons can be a disaster. We deal with this kind of issue every week. Just a few months back, Jetpack 4.0 broke thousands of sites.

Cowboy coding will make your site crash
Cowboy coding will make your site crash

How can I kick the habit?

These are a few suggestions you might want to try:

  • Disable the file editor in the dashboard. It’s actually a security hazard, giving a hacker who gains access to your dashboard the tools to modify a bunch of files in your WordPress installation. Also, don’t enable the CSS editor in Jetpack.
  • Build yourself a sandbox. You don’t need to use GIT, Vagrant and or the command line. Just install something like MAMP/WAMP. Download a copy of your site (files and database) and play with it on your own computer. If nothing breaks, then it’s safe to replicate whatever you’re doing on the live server.
  • Get a hosting provider that offers staging sites. Even cheap ones like Siteground offer that.
  • Or forget about doing all that stuff yourself, instead purchase a Managed WordPress Hosting package, and let our team deal with it.

Whatever choice you make, it’s time to hang up your cowboy hat and let your horse ride off into the sunset without you. Your site will thank you for giving up on cowboy coding!

Stop doing Cowboy Coding before is too late
Stop cowboy coding before is too late

Note: some of the links in this article are affiliate links. This means we get a small commission if you purchase after clicking through, but it doesn’t cost you any more!