2021 Q4 Sale BFCM – Free Users Sitewide Banner

  1. Documentation
  2. Codex
  3. Theming

Template structure & Overriding templates via a theme

Overview ↑ Back to top

WooCommerce template files contain the markup and template structure for frontend and HTML emails of your store.

When you open these files, you will notice they all contain hooks that allow you to add/move content without needing to edit template files themselves. This method protects against upgrade issues, as the template files can be left completely untouched.

Template list ↑ Back to top

Template files can be found within the /woocommerce/templates/ directory:

v.5.8.0View template files
v.5.7.0View template files
v.5.6.0View template files
v.5.5.0View template files
v.5.4.0View template files
v.5.3.0View template files
v.5.2.0View template files
v.5.1.0View template files
v.5.0.0View template files
v.4.9.0View template files
v.4.8.0View template files
v.4.7.0View template files
v.4.6.0View template files
v.4.5.0View template files
v.4.4.0View template files
v4.3.0View template files
v4.2.0View template files
v4.1.0View template files
v4.0.0View template files
v3.9.0View template files
v3.8.0View template files
v3.7.0View template files
v3.6.0View template files
v3.5.0View template files
v3.4.0View template files
v3.3.0View template files
v3.2.0View template files
v3.1.0View template files
v3.0.0View template files
v2.6.0View template files

How to Edit Files ↑ Back to top

Edit files in an upgrade-safe way using overrides. Copy the template into a directory within your theme named /woocommerce keeping the same file structure but removing the /templates/ subdirectory.

Example: To override the admin order notification, copy: wp-content/plugins/woocommerce/templates/emails/admin-new-order.php to wp-content/themes/yourtheme/woocommerce/emails/admin-new-order.php

The copied file will now override the WooCommerce default template file.

Warning: Do not edit these files within the core plugin itself as they are overwritten during the upgrade process and any customizations will be lost. For more detailed information, see Fixing Outdated WooCommerce Templates.

For Custom Templates ↑ Back to top

If you are a theme developer or using a theme with custom templates, you must declare WooCommerce theme support using the add_theme_support function. See Declaring WooCommerce Support in Themes at GitHub.

If your theme has a woocommerce.php file, you will be unable to override the woocommerce/archive-product.php custom template in your theme, as woocommerce.php has priority over other template files. This is intended to prevent display issues.

WooCommerce - the most customizable eCommerce platform for building your online business.

  • 30 day money back guarantee
  • Support teams across the world
  • Safe & Secure online payment