The Ultimate WordPress Development Environment

Share this article

The Ultimate WordPress Development Environment

Key Takeaways

  • WordPress development tools have significantly advanced, reducing the headache and repetitiveness of building WordPress sites.
  • Virtualized development environments are recommended over MAMP/WAMP/XAMP for WordPress development due to their isolation, easy rebuild, replication of live environments, ability to run multiple server environments on a single computer, and uniformity across development teams.
  • WP-CLI is a useful command line tool for managing WordPress installations, including installing WordPress, updating WordPress, installing plugins, resetting a WordPress database, and importing content.
  • PhpStorm is a highly recommended IDE for PHP and WordPress development, offering all necessary tools in one place, deep WordPress integration, and wide usage among top WordPress developers. Additionally, PHP CodeSniffer ensures code follows WordPress coding standards.

WordPress development has come a very long way in recent years when it comes to tooling. In the past, developing a WordPress website required some sort of MAMP/WAMP localhost setup and almost always, a rather painful headache. Maybe you’re even one of those developers who developed their website on a live environment – I was.

Luckily, times have changed and there are now tools that help take the headache and repetitiveness out of building WordPress sites on your computer.

WordPress Development

In December last year, after 3 years of being almost completely devoid of any WordPress development, I became a full time WordPress developer again. Before that 3 year stint in the payments industry, I was a full time WordPress contractor.

Being out of an industry for 3 years, gave me a unique perspective on how fast things change in computing and more specifically, web development. WordPress development is no exception.

You see, when I returned to WordPress development in December last year, I decided to look at setting up the perfect WordPress development environment. I was pleasantly surprised to see that the tooling around WordPress had advanced so much that it was much like trading in a Ford for a Ferrari.

I was excited, and still am of course, to explore all the tools and in today’s article I’m going to share with you a summary of what I have learned. Hopefully it will help you tweak your current environment and implement some of the tools that are available to you.

It Starts with the Server

To begin with, the most important piece in the WordPress development environment puzzle is the server. Without a server, we can’t do anything.

There are so many different options available today to host WordPress websites on your local environment that it gets tricky to know which one to use.

I’m going to suggest that you drop MAMP/WAMP/XAMP and start using a virtualized development environment.

Why? There are so many reasons:

  1. It’s an isolated environment. By using a virtualized environment you’re creating a development server that is isolated from your host operating system. You can install whatever operating system you like on the virtual machine and start/stop/restart it without affecting your host. It’s easy to tear down once you’re done with development and no longer need it.
  2. Messed something up? No problem! Just rebuild the environment. I’m sure we’ve all been in the sticky situation where we’ve tinkered with our server settings and blew stuff up. This is easily fixed by rebuilding the virtual environment or simply using snapshots. So now you can play around and tweak your settings without fear of failure.
  3. As close to live as you can get. You can literally replicate your live environment on your localhost if you wanted. Having these two environments exactly the same helps with debugging, tweaking and even deployment.
  4. You can run multiple different server environments, on a single computer. Have one client using Apache and another Nginx? No problem, create those two different environments in virtual machines and you’re good to go.
  5. Unified environment across development teams. If everyone on a development team uses the exact same setup, it speeds up development time and there are less questions about why something is not working on x person’s machine.

Now that you’re sold on a virtualized environment. What should you use?

I’m using VVV. For me it was extremely straight-forward to get up and running, has a good support system around and it is used by many of the big WordPress development agencies, including the one I work for, XWP.

Some of the other options for a virtualized WordPress development environment include: HGV, Wocker, VIP Quickstart.

If you decide to go with VVV, then I definitely recommend the following plugins and tools to take VVV to the next level of awesome.

  • vagrant-hostsupdater – This plugin allows your vagrant installation to update the entries in your computer’s hosts file for adding domain mappings to an IP address. This means you don’t have to manually add entries to your hosts file.
  • Variable VVV – By far the most useful tool for VVV is called Variable VVV and what it does is gives you the ability to quickly and easily create new VVV WordPress installations using the command line. Definitely check this one out

Aleksander Koko has previously written about VVV, and I’ve also recently recorded a video on how to setup VVV on your own computer.

The Power of the Command Line

Who doesn’t like a bit of command line fu, right? WP-CLI is the answer to your inner command line desire.

WordPress WP-CLI

WP-CLI let’s you manage a WordPress installation from the command line (it ships with VVV by the way).

Let’s look at some practical examples of how you can use WP-CLI in your local development environment.

  • Install WordPress. SSH’d into your server and need to install WordPress quickly? Simply use WP-CLI to create a new WordPress installation.
  • Update WordPress. There’s not much more painful than updating tons of WordPress websites by visiting each one, logging in, clicking around and then updating. You can do this straight from the command line with a single command.
  • Installing plugins. If you’ve found a great plugin that you want to install across multiple sites, again, do it with one command using WP-CLI.
  • Resetting a WordPress database. Messed something up and want to start off fresh? Easy, one command (this is getting a little repetitive isn’t it?)
  • Import content. Yep you guessed it, you can import content into your WordPress install or multiple installs with one command.
  • And so much more

That’s all quite handy stuff that you can do from the command line. Best yet, in the next section we’ll talk about an IDE and you can run all these commands directly from that IDE.

If you’re interested in learning more, check out this article on WP-CLI by Ahsan Parwez.

An IDE That Makes a Difference

Out of all the tools I am talking about today, I have a feeling that this is going to be the most contentious. When it comes to IDEs and editors it’s almost as if you’re invading personal space, and a lot of people don’t like that.

I’m not going to try and tell you an IDE is better than a text editor or vice versa. What I’m going to do is tell you my experience of switching to an IDE and how it worked for me.

I have always been someone who has disliked IDEs. Dislike is probably being kind, I hated them. I felt they were bloated, slow and cluttered.

I was a big Sublime Text fan (and still am by the way, I use it daily).

So in December, as I was getting back into WordPress development, I checked out what editors were available to write WordPress code. I was quite surprised when an IDE by the name of PhpStorm kept getting a mention.

Reluctantly, I took a look and boy am I glad that I did!

PhpStorm is the best IDE for PHP and WordPress development, in my opinion. It offers everything you need to build WordPress websites, plugins and themes all in one place and it has incredible WordPress integration (you really need to check it out).

Here are three reasons why you should consider PhpStorm this year for WordPress development:

  1. Everything you need, in one place. FTP – check, database support – check, terminal – check, version control – check, debugging – check, refactoring – check, great intellisense and autocomplete – double check! And so much more.
  2. WordPress integration within PhpStorm is second to none. PhpStorm understands WordPress deeply. Once it’s hooked up to a WordPress project it knows how everything ties together. It autocompletes on WordPress functions and even on actions and filters.
  3. Many of the top WordPress developers and agencies are now developing their code with PhpStorm. That to me is a clear sign that it’s one of the best IDEs for WordPress development available.

If you’re interested in getting started with PhpStorm, then check out a series of 7 PhpStorm videos that I recorded to get your started with the IDE.

Making Sure Your Code Is Silky Clean

The last tool that I am going to write about today is a doozy! I’m particularly pedantic when it comes to writing code. I like it to be silky clean and follow the WordPress coding standards to a tee.

But even being that pedantic, we’re all humans. And very often I find myself going through the code that I have written and cringing about a missed space or extra new line.

Being in the Open Source world, it’s extremely important that developers stick to coding standards that are defined by the projects otherwise a codebase degrades extremely quickly, especially on a popular Open Source project like WordPress.

In fact, the WordPress core team is particularly strict about coding standards and that they’re followed.

So how can we make sure that our code follows the WordPress coding standards? The answer is simple and it is a tool called PHP CodeSniffer with the WordPress coding standards ruleset.

WordPress Coding Standards

These two utilities will scan your code, find any discrepancies between your code and how it is expected to be written by the WordPress project and inform you of what is wrong. Magic!

Best of all, they will also notify you of any high level security issues that it encounters. Now it won’t catch every single security issue so make sure you’re always thinking about security when you’re writing your code but it is a good first line of defense.

Of course, I wouldn’t be able to complete this section without mentioning that PhpStorm has baked in support for PHP CodeSniffer. I’ve released a video on how to tie PhpStorm, PHPCS and the WordPress coding standards ruleset together.

In Closing

There are many alternatives to the tools above and my hope is that at the very least everything I have spoken about today gets you interested in exploring some of the awesome tooling around WordPress development.

The above tools, should you chose to use them, will give you a great foundation for getting started with a more streamlined and automated approached to WordPress development.

If you have other tools that you use, I would love to hear about them in the comments below!

Frequently Asked Questions about WordPress Development Environment

What is a WordPress development environment and why is it important?

A WordPress development environment is a safe, isolated space where developers can test changes, updates, and new features for a WordPress site without affecting the live site. It’s crucial because it allows developers to identify and fix any issues or bugs before they impact the live site, ensuring a smooth user experience. It typically consists of three stages: local (the developer’s machine), staging (a replica of the live site), and production (the live site).

How do I set up a local WordPress development environment?

Setting up a local WordPress development environment involves installing a local server environment like MAMP, WAMP, or XAMPP. Once installed, you can then install WordPress on your local server. This allows you to work on your WordPress site directly from your computer, without the need for an internet connection.

What are the benefits of using a staging environment in WordPress development?

A staging environment is a clone of your live website where you can test changes without affecting the live site. It’s beneficial because it allows you to troubleshoot issues, test updates, and make changes without risking the functionality of your live site. It also provides a platform for client reviews and approvals before changes go live.

How can I move my WordPress site from a local environment to a live server?

Moving your WordPress site from a local environment to a live server involves migrating your site’s files and database. You can do this manually or use a plugin like Duplicator or All-in-One WP Migration. Always remember to backup your live site before migration to prevent any data loss.

What tools can I use for WordPress development?

There are numerous tools available for WordPress development. These include code editors like Sublime Text or Atom, local development environments like Local by Flywheel or DesktopServer, version control systems like Git, and debugging tools like Query Monitor or Debug Bar.

How can I create a child theme in WordPress?

Creating a child theme in WordPress involves creating a new directory in your themes folder, creating a style.css file with a specific header, and importing the parent theme’s style. You can then activate the child theme from your WordPress dashboard and start customizing it without affecting the parent theme.

How can I update my WordPress site safely?

Updating your WordPress site safely involves backing up your site, testing the updates in a staging environment, and then applying the updates to your live site. This ensures that if anything goes wrong during the update, you can easily restore your site to its previous state.

What is a version control system and why should I use it in WordPress development?

A version control system is a tool that tracks changes to your code over time. It’s essential in WordPress development because it allows you to revert to a previous version of your code if something goes wrong, collaborate with other developers, and keep a history of changes. Git is a popular version control system used in WordPress development.

How can I troubleshoot issues in my WordPress site?

Troubleshooting issues in your WordPress site involves identifying the problem, testing solutions in a staging environment, and applying the fix to your live site. Tools like Query Monitor or Debug Bar can help you identify issues. Always remember to backup your site before troubleshooting.

How can I optimize my WordPress site for performance?

Optimizing your WordPress site for performance involves using a caching plugin, optimizing your images, using a Content Delivery Network (CDN), and minimizing your CSS and JavaScript files. You can also use tools like Google PageSpeed Insights or GTmetrix to identify areas for improvement.

Matt GeriMatt Geri
View Author

Matt Geri, a full time WordPress developer and Core contributor. During the day he works for XWP as a full time WordPress Engineer working on large scale enterprise projects, and his spare time he contributes back to the WordPress Core.

ChrisBMAMPvagrantvvvWAMPWordPresswordpress developmentWordPress IDEwp-cliXAMP
Share this article
Read Next
Get the freshest news and resources for developers, designers and digital creators in your inbox each week