What’s the best way to update your WordPress website if it features any customizations without losing them? Are you worried that some update might wipe out all your freshly deployed new features from your custom plugin?
I hear you loud and clear. Been there, done that! I vividly remember how I was concerned – read terrified – when I had no idea how updates and customizations work together.
Let’s put an expiry date to your concern, shall we? That expiry date is today!
As you might know, the power of code is that it can be edited and customized to address any of your business needs. WordPress, with its huge market share, is the quintessential example: thanks to thousands of themes and plugins — whether pre-built or purely custom-coded — it allows you to enhance the design and/or functionality of your site.
A site, though, that will always need to be kept updated. And that’s where the whole story gets interesting (or somewhat scary if you’re concerned about losing customizations).
Updates are vital to any WordPress website
Code is a living creature, and it needs to be properly maintained.Neglecting updates makes your website susceptible to security threats and performance issues. You also miss the chance of taking advantage of the functionality your competitors are using. This is true for WooCommerce stores as well.
Before we start, you should know that each time the word “update” pops up, it should trigger its perfect companion word, “backup,” in your mind. Specifically, you should never start any update procedure without having first a current and working copy of your site and database.
Now that we’re clear on this let’s dig deeper into the burning question.
Can you update a WordPress site without losing customizations?
The short answer is: yes, you can.
A more elaborated one is that, even if you can, the type of customization work that has been deployed on your WordPress website dictates a different upgrading process as it gives rise to different situations.
Themes and plugins are the most attention-grabbing, researched, downloaded, discussed, bought items in the entire WordPress ecosystem. The reason is that they can change drastically both how your site looks and how it works.
In fact, theme customization and plugin customization are the two most common types of work business owners hire developers for.
If you haven’t already, you’ll need some of this custom work in your WordPress life eventually.
Let’s start with the first one: custom themes.
1. Updating WordPress websites with theme customizations
First and foremost is theme customization. This can be carried out in a number of ways, but the one strongly suggested as a best practice is creating a child theme. A child theme works as a layer on top of your current WordPress theme, from which it inherits its functionalities and allows you to make customizations without impacting your theme.
When a new update is rolled out, if the work has been performed by a professional WordPress developer, you can safely upgrade your parent theme and keep taking advantage of all the customizations bundled with your child theme.
WordPress developer and Codeable expert Daniel Klose explains:
Your child theme ‘stores’ all of your customizations so that when the theme provider releases a newer version of the theme you’re using, that parent theme can safely be upgraded, but the custom functionality you’re using will remain in place.
There’s a catch, though.
The challenge with child themes
While updating parent themes is simple, updating child themes isn’t as easy as that. If not upgraded properly, an update to a child theme might wipe away the custom edits made to it. Just like any other custom code.
Child themes are usually created either by the site owner or a developer who’s been hired to add some customization to a theme. In most cases, a child theme isn’t usually “receiving” updates for this reason.
But child themes are also available as premium products you can buy. Think of child themes for the Genesis framework, those are perfect examples of child themes provided by third-party developers.
That’s where you should pay attention. When child themes are provided as products, the third-party developer will release updates that might delete your customization if implemented right off the bat.
To avoid this hassle, the best practice your developer should follow is to pack all the customizations you need into a custom plugin which will then be installed on the premium child theme rather than applying them to its file by directly editing them.
Following this approach puts the edits in a separate “place” that can easily be taken apart. The premium child theme can then be updated (if needed), and the changes can be then applied back to it by installing such a custom plugin.
To sum it up: child themes are usually created by a developer. Hence they aren’t updated as standard pre-built WordPress themes. However, there are many site owners who are relying on premium child themes featuring some customization which will receive updates from time to time.
So it’s better to know what the best practice looks like to both prevent the loss of your customization and/or understand whether the developer is a good one.
2. Updating WordPress websites with plugin customizations
When it comes to updating WordPress plugins with custom or extended functionality, you should be aware that the process is quite different.
Plugins don’t offer the possibility to create a “child plugin”. So there’s another way to add customizations to a plugin that allows you to safely update it in the future.
If you’re using a plugin that is properly coded, best practices tell your developer to take advantage of hooks, i.e., actions and filters.
Here’s a great video explanation (a bit advanced) from David Hayes:
I know they all sound like obscure terms, but here’s how Daniel explains them in an easier way:
Think of an action like an ‘area’ within the plugin where the developer can write extra code to be executed. Think of a filter as a way to replace or modify a specific output of a plugin.
When using actions or filters to modify a plugin, developers need a “place” where they can write these action or filter functions into. These are either written into a child theme (as we’ve seen above) or into a second custom plugin.
As such, these custom-written plugins don’t usually get any updates, as only the developer/site owner will make changes to them. What gets updated here is the plugin which the action and/or filter is then executed with.
Let me give you an example.
You’re using a premium plugin like Gravity Forms with custom functionality that changes the output of one of the forms on your site. If you look at your plugins list, you’ll notice a custom plugin with a filter function in it that’s responsible for this specific task.
So you have Gravity Form and another plugin customizing (or extending) its functionality, correct?
My point here is since the former is a well-coded plugin, any developer following best practices will be able to extend its functionality by leveraging actions and filters. When Gravity Forms releases an update, the custom functionality will be still in place because your custom plugin is built on actions and filters.
Even with updating plugins, though, there’s a catch.
The challenge with plugin customizations
Remember when I mentioned “properly coded plugin”? Well, that could be a hassle you could have prevented by choosing a quality plugin in the first place (or a better developer).
In fact, if it isn’t possible to deploy plugin customization through action and/or filters, the only other option available is just going off the road and ignoring best practices. Specifically, you’ll see your developer – again, not if they’re good developers – duplicate that plugin, make changes to it, and tell you to use that copy instance.
This is not recommended at all because you’ll stop receiving official updates the moment you start using a copy of your plugin.
On a higher level, you should also be aware that some major releases might replace some of the functions your plugin is using or simply discontinue old ones, and those can break the custom functionality they’re used to a different extent.
This could pertain to either a properly coded plugin as well as to a poor one. When WooCommerce, which we often forget is ultimately a plugin, released its 3.0 version, sites, and custom functionality broke because of this very reason.
That’s why having a professional WordPress developer who’s up-to-date with all deprecated functions is always a solid option you should consider.
How to download previous versions of plugins from the WordPress repository
To avoid losing your plugin customizations due to an update, you can download the previous version of the plugin and revert to the version that worked well with your site. Doing this can be risky because it can open you up to vulnerabilities or bugs, so you should test any version before using it on the live site.
Here’s how to download a previous version of a plugin:
- Go to the WordPress plugin repository and search for the plugin you want to download.
- Scroll down on the plugin page to “Advanced View” and click “Developers.”
- There, you’ll find a list of available versions of the plugin. Choose the version number you’d like to download.
- Save the file to your computer and then upload it to your WordPress site via the plugin installation page.
Testing updates on a staging site
A staging site is the best way to approach updates in a way that takes the scary part away. With a staging site, you’ll have a safe testing environment. That way, you can see whether there will be any plugin or theme data loss before it goes live to your visitors. Here’s how you can test updates via a staging site:
- Install updates on the staging site.
- Test the updates. Once they’re installed, see if they cause issues with other plugins or themes. Test your customizations to ensure they still function properly.
- Check for data loss. See if settings or data associated with the plugin or theme have been lost or overwritten.
- Make changes if needed. If you do see any red flags during updates in the testing phase, make changes to fix them on the staging site before going live.
- Once you’ve foreseen any possible issues and fixed them, update the live site.
Updating your website isn’t an option. It’s a mandatory and recurring task you should never overlook.
If one-click updates or even automated ones made you think it’s an easy routine to build, you’ll change your mind the minute your WordPress site starts having some customizations. Whether it’s some theme customizations or a custom plugin extending its functionality, you should always pay attention when running updates to not wipe out your customizations.
If you’re managing updates on your own, please follow the best practices here outlined for updating both theme and plugin customizations. On the other hand, if you’re relying on an outsourced developer, make them explain to you how they’re going to proceed with the updating process and compare it with the best practices you now have learned.
Happy (and safe) updates!
Daniel Klose is a Tech-Wiz, Blogger, and Industry Professional. Born and raised in Germany, he quickly discovered his passion for all things digital. As a full-stack developer, he now supports small and medium-sized businesses in their digital endeavors, with a focus on scalability.