WordPress version control: Complete guide

WordPress version control plugins

Version control is essential to any WordPress website, especially where more than one person is making changes to it, or where you need a historical record of changes. Discover how to manage your site more effectively with the best WordPress version control plugins.

WordPress is a powerful tool for bloggers and for anyone creating websites. But once you’ve built your site, how do you keep track of the ongoing changes to it?

As a site administrator, you probably know how difficult it is to keep track of WordPress revisions and other changes. There are various parts of your website which might benefit from a good version control solution:

  • The theme and plugins.
  • Website content, such as pages and posts.
  • The files and documents in the Media Library.

Version control (sometimes called source control) is a way to manage and track changes to a file or group of files over time. Keep reading to discover the best WordPress version control plugin for each of these situations.

What is WordPress version control and do I need it?

Version control allows you to keep track of changes to your code, website content, documents, WordPress revisions, and anything else across any number of development environments. It allows you to easily see what's been changed and to view a history of all modifications. A good WordPress version control system lets you roll back to any historic file version or change in case something goes wrong. As a result, you can always restore to the state before a particular change occurred.

Without version control, teams can regularly find themselves in difficult situations:

  • Two team members accidentally overwrite each other’s work.
  • Someone hits submit on a new line of code, only to have it disappear or get lost in the shuffle.
  • A mistake occurs and it’s possible to see which team member was responsible.
  • Two people update the same document at once.
  • You lose access to an older version of something.

And when this happens, it creates headaches for everyone and wastes time. Sometimes, important work is lost forever.

Most web hosts come with automatic backups, and you can often roll an entire website back to a specific backup. However, that’s not a good solution to version control problems. Rolling back means losing ALL the changes since the backup, not just the specific WordPress revision that you want to roll back. This is a pain if you or your colleagues have made lots of recent changes to the site. And it’s a total nightmare if your site contains customer data - for example, you can’t roll back an e-commerce site without losing your recent orders!

It’s much better to add proper version control to your site. You can learn more about this in Kinsta’s blog post about version control.

Benefits of using WordPress version control

Maintaining the capital investment in your website is essential. But it's not easy to recover from version control problems without collateral damage. Even small teams can become too much to keep track of. Here are some advantages of using WP version control:

Traceability

A version control plugin with traceability mechanism provides evidence of all WordPress revisions and changes made over time. This allows users to track the development of a file through its various stages. The project tracks the contributions of multiple developers or contributors. Changes are tracked from the original to the many improved versions and, finally, to the current version.

Including a changelog with each version of a dataset helps people to understand what was changed and when in the history of the data. We can see the changes from a granular level and identify the root cause of any problems. In addition, team members can identify the order in which changes were made. The amendments can be cataloged in this way.

The right version control software can be a lifesaver. Microsoft SharePoint and Google Docs (formerly Google Docs) have built-in version control tools to ensure that the most current iteration is available to customers. So, if someone makes a change that breaks something else, you can quickly go back and see what was changed - or why it was changed.

File history

The history of a file or document provides valuable information about the developer/author and the editing date. It can also gives an overview of the purpose of the WordPress revisions and content changes made.

Identifying the authors of the documents helps to link the document to specific contributors so that the team may look for patterns in the behavior and flow of activities.

Reduction of errors and duplicates

Version control is a crucial aspect of project management and is often used to keep track of changes made to files, content and documents. It can lessen the duplication of multiple and outdated versions. This will reduce the number of errors that are caused by from conflicting information.

Management oversight

Version control is a software tool that helps teams to track changes in a document or file. It allows management to have a comprehensive perspective of the project's development. They are aware of the author, the timeline of progress, and the purpose of these WordPress versions against the project’s long-term objective. Version control helps managers to identify recurring issues that may stem from specific team members.

Adhere to compliance

For many organizations, regulations and compliance are top priorities. Version control is handy for managing organizational changes, particularly if you have multiple developers working with your code or data. You must maintain a detailed audit trail so that you can manage risk.

Additional benefits for development teams

Finally, there are some additional benefits for developers using version control to manage the codebase of a WordPress website:

Merging and branching

Version control provides a way to manage, review and maintain the evolution of your projects as a team. With version control, team members can work simultaneously on the same file independently without interfering with each other's contributions. Every contributor works on an independent stream of change – commonly referred to as a branch.

Branching and merging are standard practices for managing projects. When you merge two branches, the main branch becomes a parent, but you can still commit changes from the last time to the new one. After a while, development is pushed back to the old branch in preparation for merging it with the original trunk. This can be useful if your local version is ready to release while another team works on bugs or polishes up their feature.

Better communication

Version control is an increasingly popular means of collaborating on code. It enables a simple approach to workflow coordination and enables team members to work more productively. It leads to efficient workflow coordination, which frames each individual as a unit working towards a specific goal.

Efficiency

Version control allows teams to achieve efficiency and consistency in their work, allowing for easy automation of complex processes. This makes testing easier since problems can be detected quickly with little impact on the user experience.

Version control uses branches to track the progression of a file and other WordPress revisions. Developing and testing an application is easy with version control as you can revert to an earlier version when errors are discovered.

As you can see, there are lots of reasons to implement WordPress version control on various areas of your site. Next, let’s look at the best way to add it.

Version control for WordPress posts and pages

Fortunately, WordPress itself has several built-in types of version control. We’ll look at this first. After considering how far it goes towards meeting your needs, we’ll look at additional ways to add version control to a WordPress site.

Only one person can edit a page or post at a time

WordPress has an effective version control mechanism for preventing multiple editors from working on the same page/post at once. This works for all post types, including custom post types (CPT).

WordPress version control - Currently editing

When you view the main list of pages, posts or any CPT in the WordPress admin, any posts that are currently being edited by another user are clearly marked. That way, you know not to try to edit it.

If you do try to edit a post that someone else is currently working on, then WordPress will prevent you from doing this. That way, it prevents any version control conflicts.

Try it for yourself!

Open the ‘Edit’ screen for any page or post. Then, ask a colleague to log into their own account and try to edit the same page. They will see a notice telling them that they can’t edit it until you have finished. There is also an option to take over editing.
This prevents version control conflicts on WordPress pages and posts.

All of this collision detection happens automatically and you don’t need to do anything to set up this type of WordPress version control.

The warning says: "This content is currently locked. If you take over, [user's name] will be blocked from continuing to edit." The 3 options at this point are:

  • Go back - Return to the previous page without making changes.
  • Preview - View the current version of the page without making changes.
  • Take over - Take over editing the page. This will display a notice to the other user, telling them that they cannot edit it any longer. Doing this will lose any un-saved changes that they have already made. As a result, you should only take over after asking their permission. For example, people often save a page and then leave it open in their browser, even though they are no longer working on it.

How to view revisions of WordPress pages or posts

WordPress also stores previous revisions to previous pages and posts. You can easily view previous versions, compare with the current version, and roll back as needed.
This is how to view previous revisions and roll back if needed:

  1. On the ‘Edit’ screen for a page or post, click ‘Screen Options’ at the very top of the page and make sure the ‘Revisions’ box is ticked.
  2. Scroll down to the revisions section and click on a revision.
  3. The changes in every revision will be highlighted, with Blue for the additions, and Red for the deletions.
  4. Click ‘Restore’ to restore to a specific revision. This will overwrite the current version of the page/post.
View revisions of WordPress pages or posts

Tips on handling revisions in WordPress

It can be challenging to read the revision as it is displayed in code form instead of content. As a result, here are some tricks to help you find the correct revision:

  • By clicking Load, the revision will load in the editor. It will let you see the content. To save the changes, you need to click Update or Save Draft.
  • To restore a revision from a specific date, use the revision date above the revision listed on the right.
  • You can see the number of characters added or removed in every revision present under the date. The green plus shows the added characters, and the red minus shows the removed ones.
  • Revisions can quickly clutter up the WordPress MySQL database. To fix this, install the free Simple Revision Control plugin. This lets you control the number of revisions which are stored for each post. You can also bulk delete revisions of posts/pages with a high number of previous revisions.

Who has access to see the WordPress revisions?

All Editors and Administrators on your site can see the post revisions. Users with the ‘Author’ user role can only see the revisions of their posts and pages. Lastly, Contributors can see revisions on their drafts only.

How to restore part of a revision

You can copy specific parts of a revision to the current post or page:

  1. Highlight the section of the revision that you want to recover.
  2. Right-click and click copy.
  3. Cancel to quit the revisions window, and then ppaste that part of the Revision into your post or page.

Limitations of the built-in WordPress version control

There a few limitations to the version control that comes with WordPress itself:

  • You can’t draft changes to an existing post - When you create a new page or post in WordPress, you can save it as a draft until it’s ready to be published. Unfortunately, this doesn’t work for pages that are already published. When you make edits to an existing post, you have to publish them immediately. The only way to draft changes for future publication is to clone the post and manually copy the changes when you’re ready.
  • There’s no built-in version control for widgets, menus or source files - It’s great that WordPress prevents multiple people from editing pages and posts, but that’s as far as it goes. Any number of people can make simultaneous changes to other parts of your site. This creates inevitable version control conflicts and problems.
  • There’s no version control on Media Library files - WordPress also doesn’t provide any way to link different versions of a file in the Media Library, such as a PDF document or image. To do that, you need a WordPress file manager plugin with version control like Document Library Pro which we’ll look at later.

These weaken the case for WordPress in the SharePoint vs WordPress debate, as some platforms have stronger version control. However, instead of abandoning WordPress, you can fill the gap by installing a WordPress version control plugin.

The best WordPress version control plugins

Since the built-in WordPress version control is limited to posts and pages, you need some additional tools in order to improve on this. The easiest way to version control additional parts of your website is to install the right plugin or software tool. That way, you will always know what's been changed and who made the WordPress revision.

Generally, you should use a WordPress plugin for adding version control to your website content; and a hosted version control system for adding source control to your website’s file system. It all depends on what you need to control the changes for. As a result, we’ll approach each area separately.

Version control plugins for managing documents and Media Library files

The content of a WordPress website consists of much more than just the pages and posts. There’s also the files which are displayed on the website, either directly on the page (e.g. as images or embedded audio/video players), or for your users to download to their own computers (e.g. the documents in a downloads library).

Most website owners regularly replace the files on their site. For example, if you have created a WordPress document library or PDF library then you will periodically replace the current documents with a new version.

Unfortunately, WordPress offers no version control features for your documents and Media Library files. Your only option is to upload the new file from scratch and update all the existing links to it on your website. After that, you can either leave the old file sitting in the Media Library (taking up storage space on your server, and with no links to the new document); or you can delete it forever. It’s much better to add proper version control to the WordPress Media Library. Here are my favorite plugins for this:

Document Library Pro

Grid layout document library tiles

Document Library Pro is the ultimate solution for displaying any type of document, file or resource on your website. It basically creates a front end media library for your site, allowing users to easily search and find the information they’re looking for. This document management plugin is hugely popular for creating a WordPress document library, PDF library, audio library, and much more.

Either use it on its own to create a public document library, or buy it as a bundle with the Password Protected Categories plugin to create private file libraries (e.g. for your WordPress-powered company intranet).

WordPress version control Media Library pluginDocument Library Pro comes complete with a fully featured version control management system. Whenever you create a ‘Document’ (which can actually be any file type), you associate it with an uploaded file in the WordPress Media Library. Users can download the current version of the document file when they visit your document library.

You can replace the current file with a new version at any time, without losing other important information such as the document name and description. There are options to add a version name or number for each file, and view historical changes.

The version history is clearly listed, so you can easily see previous versions, delete old versions if no longer required, and even revert to previous versions. That way, you can manage current and historic versions of your documents, which are stored in the Media Library and displayed in your front end document library.

How to version control your documents

The following instructions assume that you have already installed Document Library Pro and added some downloadable files. If you haven’t done this yet, then install the plugin now and set it up. You can easily add documents either manually, via CSV upload, or by dragging and dropping files using the built-in ‘Import’ feature.

  1. First, go to Documents → Settings and make sure version control is enabled on the plugin settings page.
  2. Now, click on the main ‘Documents’ link in the WordPress admin and edit any existing document.
  3. Find the ‘Publish’ section in the top right corner of the ‘Edit Document’ screen. Click to open the version history section.
  4. You will see a list of all the previous versions of the document. You can view information about each one, delete previous versions of files, and click to restore to a previous version.

Enable Media Replace

The free Enable Media Replace plugin is a simple and effective plugin for adding basic version control to Media Library files.

This free WordPress plugin works by adding a ‘Replace’ button to each file in the Media Library. When you need to replace a file or image, simply find it in the Media Library and click the ‘Replace’ button. You can then choose whether to replace the old version with a newly uploaded file by overwriting all the old links, or automatically updating all the links. Either way, it’s an effective way to avoid cluttering up the Media Library with old versions of files which are no longer used.

However, this free WordPress revisions plugin isn’t perfect because it doesn’t add any more advanced version management features. It simply replaces old files, and doesn’t keep details of the version or links to previous versions. As a result, if you need more advanced version control for the Media Library then I’d recommend Document Library Pro instead.

Plugins for improving version management of WordPress pages and posts

As we saw before, WordPress has some limitations in the way it version controls pages and posts. For example, you can’t draft changes to an existing page and save these to publish at a later date. To help with this, here are some plugins for improving updates to on-page website content.

WordPress page builder plugins

If you use a page builder plugin on your site, then it’s likely to have its own built-in version control.

For example, Elementor has version control for editor changes history for posts, pages, templates, etc. You can learn more about this in their revision history documentation.
Have a look at what version management is available in your chosen page builder plugin.

Duplicate Post

It's annoying that WordPress doesn't let you save drafts of published posts. Fortunately, you can easily achieve this with the free WordPress plugin.

This is how to create drafts of published posts in WordPress:

  1. Install the Duplicate Post plugin.
  2. Go to the list of pages/posts (or any custom post type).
  3. Hover over the page that you want to create a draft of, and click the 'Rewrite & Republish' link.
    How to duplicate post in WordPress
  4. Make the changes to the new draft which appears in the list. Click 'Save' as many times as you like.
  5. If you like, click the 'Save changes and compare' link. This shows a side-by-side view of the original and edited versions of the page/post so that you can compare what has changed. When you're happy, click 'Return to editor'.
  6. When you're finished, click the 'Republish' button and confirm that you want to add your changes to the live version of the post.
How to republish a post in WordPress

Tip: You can also schedule changes to WordPress pages and posts in advance. Simply choose the date and time when you click 'Republish', and the changes won't go live until then.

WordPress source control systems

Finally, let’s talk about version control for the files that are used to construct your website. This is different from your website content, which we have already covered. Essentially, we’re talking about the WordPress core files (which comes from wordpress.org), your WordPress theme, and all the plugins and custom functionality used on your site.

You can manage these using the wide range of tools which are used to manage any type of software development. Most of these are called a “VCS" (version control system).

A VCS is a set of systems that allow you to manage changes in large software projects by maintaining track of every change and when it went into production. The best version control software products can easily keep track of earlier versions, WordPress revisions or even multiple versions.

If you are a digital worker or software developer, you already know the importance of keeping track of changes to your project data. Thanks to version control tools, or SCM software like Git, you can keep track of every change and roll back to the previous state if an issue arises. It's a convenient way to bring data back into alignment with the original version.

While there are many different version control systems, we will focus on the most popular for WordPress projects. Some of these are WordPress plugins, and others are hosted SAAS platforms.

Git

Git is the most popular version control software for WordPress. The Git version control is very comprehensive and ideal for individual developers and teams of any size.

With Git and WordPress, you can easily manage version control, organize your code, and track changes to your projects in one centralized location.

Bitbucket

Bitbucket is also a hugely popular VCS among WordPress professionals. It has similar features to Fit version control, so read about both systems and consider which best meets your needs.

VersionPress

VersionPress tracks every change in WordPress like version control tracks changes to files. As a result, you can see all the latest changes made to your site, whether in your local development folder or live on the web.

VersionPress is a free VCS and works flawlessly with any theme, plugin, or page builder plugin. It lets you track changes made to your applications without affecting other users or distributing changes across the globe.

VersionPress WordPress Version Control

VersionPress tracks every change you make, whether it's an action such as creating a new post, plugin installation, or something more general, like applying a theme override. All changes are logged in real-time, and VersionPress gives you an option to undo an action without affecting other actions or roll back to the stage before you act.

WP Rollback

WP Rollback is a reliable way to revert to previous versions of themes and plugins. The plugin connects to the WordPress repository and pulls any publicly available version of a plugin or theme for your site.

This is not a traditional version control system and only covers plugins and themes. However, it does provide you with a quick undo button if things go wrong. In addition, you get high-level performance features like cloning and branching in your WordPress version control system.

WP Rollback WordPress Version Control Plugin

Start tracking changes in WordPress with version control

Version control systems are a godsend for making changes to a WordPress website. Without one, there is no way of knowing who made the change or what changed.

Whereas with one of the best WordPress version control plugins, you can do it easily when you want to restore something. Just find the correct file and make changes in the right place; it will be restored exactly as it was before.

There are many kinds of WordPress version control system, so you should pick the one that works best for you. Here are my recommendations for different types of website content:

  • Document Library Pro for version control of Media Library files and other downloadable resources.
  • Duplicate Post for better version control of WordPress pages and posts.
  • Git for source control of the WordPress core, themes and plugins.

Please share your thoughts...

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