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:
- How can I check that weather the theme has custom coding or not,
- How can I safely update the theme without any customization loss and any data loss.
Please help me in this regard.
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:
- How can I check that weather the theme has custom coding or not,
- How can I safely update the theme without any customization loss and any data loss.
Please help me in this regard.
Share Improve this question asked May 6, 2019 at 13:05 ItstudentItstudent 32 bronze badges 1- 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 ♦ Commented May 6, 2019 at 13:20
1 Answer
Reset to default 3- 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.
- 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.