Child themes have been in use in WordPress for more than seven years and the concept of using them to extend a parent theme is now an established best practice in theme development. The idea is that modifications made in a child theme will not be overwritten when an update is available for the parent theme.
It is generally thought that all edits made in a child theme are future-proof, but this assumes that parent theme authors are developing with child theme users in mind. Indiscriminate changes to markup and selectors can cause serious and unexpected design breaks in child themes.
In a recent post titled “Theme Updates Should Not Induce Panic Attacks,” Leland Fiegel reminds WordPress users that child themes are not totally immune to problems with updates.
“Child themes are certainly a safer alternative to modifying parent themes directly,” Fiegel said. “But characterizing child themes as ‘safe’ while ignoring the risks that irresponsible parent theme updates bring to the table can lead to a false sense of security.”
Fiegel references a WordPress.org support forum request where a user of the popular Avada commercial theme struggled to repair breaking changes that came with theme updates. The situation inspired Fiegel’s post, as it is especially common with WordPress themes loaded with features and marketed as the only solution the customer will ever need.
Child themes are the first line of defense in mitigating problems with updates. When using child themes that make a lot of changes to template files, the Child Theme Check plugin can be useful for reviewing changes in the parent theme after an update to see how they differ from the child theme templates. Once installed, the check can be initiated under the Tools menu.
Child Theme Check automatically runs through all the parent and child theme files and shows the user a status page indicating which files are changed or outdated.
The plugin also shows a diff for each specific file that has changes, highlighting additions and deletions:
As many theme developers still do not keep a changelog, there’s no easy way to know what changes a user can expect in an update. Running the Child Theme Check plugin after an update from the parent theme can be useful for finding changes that you might want to add to your child theme’s customized files.
In the case of a security update, vulnerabilities can be preserved in the child theme template files if the user has changed them and hasn’t been notified of the update. It can also help track down more cosmetic issues that pop up as the result of an update, such as markup and selector changes. Knowing the file and line where the change was made can drastically cut down on time troubleshooting an update.
If you’re running a highly customized child theme, the Child Theme Check plugin can help bridge the gap to cover the instances where a child theme is not entirely future-proof and help keep your site safer. Download it from WordPress.org to have on hand for the next time you want to review parent theme updates.