WordPress version control

For developers, version control is a staple of managing code. But now, some plugins have made this once-complicated concept available to regular WordPress users. Today, whether you’re a developer or a regular WordPress user, you can use WordPress version control to track changes to your site and keep your data safe.

In this post, we’ll give you a brief introduction to the general concept of version control and then get into some WordPress version control plugins that make it easy for your to track changes to your WordPress site and its code base.

Introduction to WordPress version control

So, what is this fascinating term called version control? There are two basic functions of version control. First, it keeps track of a directory of files by documenting what changes were made, who made the changes, and when the changes were made.

  • Version control creates different “checkpoints” in your file directory, enabling you to quickly go back to a previous point if needed.
  • Beyond that, version control also allows multiple people (often geographically separated) to work on the same set of files at the same time.

Most of the time, WordPress version control is focused on the first point (creating checkpoints).

There are many version control systems, each with its own set of pros and cons. And while each has its own interface, the core concept of data management through regular backups and restores is the same.

Generally, there are two sets of data you want to control with WordPress:

  • Files
  • Database

To make the process as simple as possible, you should just use your entire WordPress directory as your file base. And you should also take periodic backups of your database to keep multiple versions.

The main value of why you should consider experimenting with version control is this:

Enabling WordPress version control ensures that your data is safe * and you also have access to older versions of your site. In case you find any errors on your website, you can safely roll back changes to an older version thanks to WordPress version control.

For example, even if you follow all update best practices, things can still go wrong. That’s why version control can be so helpful!

* To be absolutely safe, you need to keep offsite backups. Otherwise, even WordPress version control can’t save you if a virus wipes out your entire server.

WordPress version control with Revisr

Revisr is a WordPress version control plugin that lets you manage your WordPress files and database directly from your WordPress dashboard. In order to fully understand the plugin, you should probably go through the basics of Git first (the next plugin we feature is a bit more beginner friendly).

When you install and activate Revisr, it shows you the status of your current repository. But Git isn’t tracking any files yet. You first need to select the files you want to track, “stage” them, and then “commit” them. You may want to skip your uploads folder as Git is not very efficient at handling non-text files.

Using Revisr for WordPress version control

Imagine a commit as a snapshot of the state of your project. Once a commit is created, it enables you to revert to that state of your project at a future date. You can create a detailed commit message to identify a commit. At the system level, a commit is identified by a large hexadecimal number, called the commit hash. These terms are a little complex – so again, the next plugin offers a simpler way.

Revisr also supports branching in Git. Branching in Git enables you to create divergent workflows from a common point in history, identified by a commit. Branching is especially useful when you want to try out an experimental change, but may want to revert back to the original state if it fails or in case of an emergency.

Further, once you have set up Revisr and Git on your local machine, you can send the whole repository to the cloud using the push feature.

One word of caution when using Revisr. Upon creating a Git repository in your root directory, Revisr automatically creates a .git directory that contains all the information about your repository and its changes. Make sure this directory is inaccessible on your site, as a potential attacker can gain unhindered access to your project in that case.

WordPress version control with VersionPress

At this point, you might realize that Revisr does a lot of what Git already does. Why, then, do you need a second plugin? Well, Revisr may end up being a bit too complicated for the beginner, which is why the creators of VersionPress decided to make things simpler in a few different ways.

WordPress version control with VersionPress

VersionPress documents each change and lets you roll back.

Once active, VersionPress tracks every change in WordPress like version control tracks changes to files in a repository. Unlike Revisr, it does not require you to make commits, but automatically does so after every change.

For instance, when you create a post or install a plugin, VersionPress tracks it. For every change that it documents, VersionPress gives you an option to either undo an action without affecting other actions or roll back to the stage before you performed the action.

Final thoughts

WordPress version control is a great way to keep track of your WordPress site’s code and get easy snapshots that you can revert to if necessary. But which of these two version control plugins should you actually pick?

  • If you’re already familiar with Git and version control, you should be good with Revisr.
  • If you’re new to the concept and have never pushed a Git commit, then you should definitely go with VersionPress because it’s more beginner friendly than Revisr.

Did you try these tools? Do let us know in the comments below.

Yay! 🎉 You made it to the end of the article!

0 Comments
Inline Feedbacks
View all comments

Or start the conversation in our Facebook group for WordPress professionals. Find answers, share tips, and get help from other WordPress experts. Join now (it’s free)!