48

If you are upgrading wordpress, follow these simple steps to maintain the customization

As a beginner, when you want to customize your WordPress theme, you simply paste code snippets directly into your theme files. This becomes a problem when a new update is released for your theme because updating a theme wipes out all customization. Recently one of our readers asked if it was possible to update a theme without losing the customization he made. In this article, we will show you how to update a WordPress theme without losing customization. There are many ways to upgrade a WordPress theme. In this post, we’ll look at a few different methods, from automatically upgrading to ensuring a customized theme isn’t unintentionally over-written.

Back Up Your Theme Files

Use whatever method you feel most comfortable with. You may want to simply copy your entire WordPress directory to your computer using FTP and backup your database with a plugin. Snapshot Pro, or other third-party backup sites like VaultPress, can run automated backups on a schedule to help make sure your site is always stored in a safe of site location.

Automatic Upgrades

Automatically upgrading your theme is easy and straightforward. There are a couple of ways to take advantage of automatic upgrades:

  1. In your WordPress dashboard, go to Appearance > Themes. Any themes that have updates available will display an alert banner. Click on the theme you want to upgrade and click on “update now.
  2. In your WordPress dashboard, go to Dashboard > Updates. The themes that have updates available will be listed. Select the theme you want to update and click “Update Themes.”

Contact us

Libra Web Solutions service include: WordPress Module Development Service, WordPress Development, Hire WordPress Developers, WordPress Store Development, WordPress Website Development

This is also a quick way to update multiple themes.

WordPress 3.7 introduced automatic background updates for themes and plugins, which is disabled by default. To turn this feature on for themes, add the following snippet to your theme’s functions.php file:
{code type=”php}
add_filter( ‘auto_update_theme’, ‘__return_true’ );
{/code}
This feature will only work for themes downloaded from the WordPress Theme Repository. It you are using a premium theme, it will not automatically update. Premium theme providers usually offer their own instructions for upgrading themes.

Uploading and Replacing an Existing Theme

Most theme providers require that you manually upload a new version of a theme and replace an older version in order to upgrade it.

However, if you go to Appearance > Themes > Add New and try to upload a new version of a theme that is already in your site’s themes directory, it will fail and you’ll get an error message telling you the destination folder already exists.

The reason for this error is due to the fact you can’t have two folders in your themes directory with identical names (obviously!).

There are a couple of simple solutions:

  1. Login to your site via FTP or cPanel and delete the old theme and then upload the new version. Make sure you make a backup of the old version of your theme just in case something goes wrong.
  2. If deleting your old theme makes you nervous, another option is to rename the old version of the theme. This will allow you to successfully upload the new version of the theme.
    • Login to your site via FTP or cPanel and navigate to wp-content/themes/ and find your old theme.
    • Rename your old theme something like “theme-old” (replacing “theme” with the name of your theme).
    • Upload your new theme.

The old and new versions of the theme will both appear in the themes interface, but you will be able to distinguish them by their folder names and version numbers.

Contact us

Upgrading a Customized Theme

A child theme is a theme that inherits the functionality of another theme, called the parent theme. Child themes allow you to modify or add to the functionality of the parent theme.

Most importantly, creating a child theme lets you make changes to your site without touching your original theme’s code, allowing you to update your site without the threat of lost all the customizations you’ve made.

If you want to upgrade your theme but made customizations without using a child theme, read on.

Uploading Only Changed Files

If you’ve made changes to your theme’s code, you may want to see if the updates in the new version of your theme are extensive.

If your theme’s developer has published a list of changes in the new version in a changelog or a readme file and only a file or two have been changed, you may opt to just upload and overwrite the files in the older version via FTP or your cPanel.

If any of the updated files happen to be ones you’ve customized and you remember which lines of code you’ve changed, you can make the customizations again via Appearance > Editor.

Contact us

Re-customizing Your New Theme

If you remember all the customizations you made to your theme or you’ve saved them somewhere, the easiest way to re-customize it to automatically upgrade it as per the methods above and then make the customizations to your site again.

Yes, it’s annoying to have to make all the customizations a second time, but at least this time you can implement a child theme so you don’t have to worry about doing this again.

Make sure you make a backup of your site before doing this so you can revert to your old theme if something goes wrong.


Libra Web Solutions service include: WordPress Module Development Service, WordPress Development, Hire WordPress Developers, WordPress Store Development, WordPress Website Development

What If I Can’t Remember My Customizations?

If you haven’t saved your customizations somewhere or you can’t remember what changes you made, don’t stress! It makes it harder to upgrade your theme, but it’s still possible.

There are programs that can help you compare two version of your themes, i.e. your old version versus your old customized version, or your old customized version versus the new version.

Upgrading themes to the latest version ensures you have not only the most feature-rich version, but all the most secure.

Whenever you do update your themes, always make a backup of everything – your old theme, database and new theme. If something does go wrong while you’re editing your file, you will have a backup available so you can start the process again without losing any important files


Libra Web Solutions – Digital Transformation Company Mumbai India, with 100+ customers from 15+ countries, delivered 200+ projects. Please get in touch with us at info@librawebsolutions.com for Web development, Web Design, Responsive websites design & development, UI/UX, Website redesign, Website Maintenance
.

Written by

Sharmila specializes business development, lead generation, customer service. Shas a interest bringing traditional business into online. She currently handles business development, customer support at Libra Web Solutions