What causes outdated templates error in WooCommerce
Most theme developers customise the WooCommerce store pages by overriding the default templates in WooCommerce plugin with new custom templates in their theme.
WooCommerce plugin offers the templates for the basic functioning of the store. However, store owners and theme owners would want to customise this basic template.
For example, the WooCommerce plugin has a file named single-product.php to display a single product page in the store. This template has the basic design and functionalities but nobody wants to use the default basic design. So, theme developers or WooCommerce store owners decide to customise the page to make it unique from other stores.
One of the different ways to customise the default WooCommerce templates is by creating a new folder named woocommerce in the theme folder and adding a new file with the same template name (single-product.php for example) inside it.
This way, theme developers can override the default single-product.php template file in the WooCommerce plugin folder with a customized single-product.php template file in the woocommerce folder inside the theme folder.
Usually, the custom template in the theme folder is created based on the default WooCommerce template file.
The problem with this method is that WooCommerce will update the template files in their new major version releases. So, when you update the WooCommerce plugin, the default template files are updated and WooCommerce would expect your website to use the new version of the template file.
However, WooCommerce can’t use the newly updated template files from its plugin folder if they are overridden by custom template WooCommerce template files in the theme folder.
So, instead of using the newly updated WooCommerce default templates, WordPress will use the templates from the theme folder which are created based on an outdated WooCommerce version.
How to fix outdated copies of WooCommerce templates error
The correct way to fix this error varies based on various factors like whether you use a
- licensed WordPress theme, or
- licensed WordPress theme, or
Check for theme update
If you are using a licensed WordPress theme, you can check if the theme has a new version. In the new version of the theme, the theme developer might have updated the custom WooCommerce templates.
If updating the theme doesn’t fix the problem or there is no update available, you can contact the theme developer.
Please remember that theme developers may take a few days to fix the problem and release a new version after the WooCommerce update. So, you can wait a couple of days before you update the WooCommerce plugin. When the theme developer releases the new version to support the new WooCommerce version, you can update both the theme and WooCommerce plugin.
If your theme developer doesn’t release the new version to support the latest version of WooCommerce, you are on your own. Then you can consider changing to a new theme that supports the latest version of WooCommerce.
Changing the theme may not be a practical solution for most businesses. But it will solve the current problem at the cost of many other problems.
So, the next option is modifying the WooCommerce templates.
Modify the custom WooCommerce templates in the theme
If you are using a custom WooCommerce theme created by you, your development team, or agency, you need to fix the outdated WooCommerce template problem by modifying the custom template files.
The WooCommerce template files in your theme are now outdated because they are based on the templates of an earlier WooCommerce version.
So, what you need to do is rewrite the custom WooCommerce templates in the theme to match the newly updated template files in the latest version of the WooCommerce.
Here is the step by step process to do it.
Step 1: Get the list of templates that override default WooCommerce templates
The first thing you need to do is get the list of all custom WooCommerce template files that override the default WooCommerce templates. The custom templates will be in the woocommerce folder inside the theme folder.
To get the list, go to WooCommerce > Status and Choose the System status tab.
Scroll down to the Templates section at the bottom of the page.
Here you can see the list of all custom template files that override the default WooCommerce templates.
If any of the custom templates are not up to date to the WooCommerce version, WordPress will show that those templates are out of date.
Step 2: Backup of the outdated templates
In the next step, we will be adding new WooCommerce templates to the theme folder. When you do so, the new files will replace the outdated template files because they will have the same names.
This may create a problem.
The outdated template files may contain custom code that gives custom functionality or design to your WooCommerce website. So, you need to add that code to the new template files as well.
If you don’t copy those files, you will lose them when they are replaced by new template files.
To back up the files, you can either move them to another location or download them to your computer. Renaming the files is another strategy to back up. If you rename the files, they will not be replaced when new default WooCommerce template files are added to the folder.
Now you don’t need to worry about losing the custom code that gives unique functionality and design to your website.
Copy 3: Copy new default templates to the theme
You can find the new default WooCommerce templates in the wp-content/plugins/woocommerce/templates folder.
Check which files are out of date in the System status and copy those templates to wp-content/themes/theme-name/woocommerce
Step 4: Add the custom code to the new WooCommerce theme
Now you have the latest default WooCommerce template in your theme but that is not enough. This will fix the outdated copies of WooCommerce template error.
However, you will miss the custom changes you had on your WooCommerce pages. To add these changes to the website, copy the custom code from the old or outdated WooCommerce templates, and add them to the newly added WooCommerce templates.
So, now you have the latest default WooCommerce template with all your custom code which should solve the outdated copies of WooCommerce template error.
Outdated WooCommerce templates error is easy to fix if there is not much custom code in the custom WooCommerce templates in the theme folder.
However, adding the custom code from an outdated WooCommerce template to the new template may cause code-conflict sometimes which may break your website. So, you will need to do a lot of work to fix this issue.
Moreover, you will face a similar problem again and again when WooCommerce updates the template files.
The best way to fix this problem is to avoid using custom templates to customise the design of WooCommerce pages. Instead of that, theme developers should use WordPress hooks to customise the WooCommerce templates. This way, you don’t override the default WooCommerce template files with custom template files.