0

My client asked me to update his theme. I have listened that when theme updated all of custom code is overwritten. Now I want your clarification in following things:

  1. How can I check that weather the theme has custom coding or not,
  2. How can I safely update the theme without any customization loss and any data loss.

Please help me in this regard.

  • 1
    This can't be done without extensive manual adjustment, your not supposed to be able to do this, that's why child themes exist – Tom J Nowell May 6 '19 at 13:20
3
  1. Download a copy of the theme - if it's available in the WordPress repository, grab that. If it's a premium theme, have the client provide their credentials to download, or just have them provide the .zip file directly. Make sure that you obtain the exact version that is being used on the client's site - not the latest version.

Then, download the theme they're currently using, and use a file comparison tool such as BeyondCompare to compare the files. Make a list of whichever ones are different.

  1. The only safe way to proceed is to create a child theme. You'll want to copy only the customized files into a separate folder, and create a very simple style.css file with comments at the top that tell WP this is a child theme of whatever the parent is.

Then, you can delete the parent theme, upload the "clean" copy (the one you obtained directly, not the one they were previously using), upload the child theme, and activate the child theme.

From then on, you can safely update the parent theme as often as needed. Occasionally you may still need to update the child theme - whenever the parent makes significant changes to the files that are in the child theme.

| improve this answer | |
  • Is it also safe to adopt first option as I have not worked with child theme. – Itstudent May 6 '19 at 13:30
  • 1
    These are not options, they are steps. No, you absolutely must develop a child theme or else the problem will continue - and some hosts and plugins automatically update themes, so all the customizations will continue to get lost periodically. – WebElaine May 6 '19 at 13:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.