The WooCommerce template files are different from the WordPress Template files look at this to see how it works and the template file for shop pages is archive-product.php

Usually, all themes provide a separate sidebar area for the shop page, did you check if your theme is compatible with WooCommerce?
If yes then you should have a sidebar available under Appearance->Widgets with name similar to 'Shop Sidebar'

How to override a template?

To override the shop page,
copy: wp-content/plugins/woocommerce/templates/archive-product.php
to wp-content/themes/your_theme_name/woocommerce/archive-product.php

and then make the necessary changes to the template in your themes folder.

What happens is WooCommerce checks for the archive-product.php file in theme directory first and if it finds a file in woocommerce/ directory then it will use that file instead of the default one.
So now you have to edit the file inside your_theme_folder/woocommerce to make any changes.

Answer from user6552940 on Stack Exchange
🌐
WooCommerce Developer
developer.woocommerce.com › classic theme development › template structure & overriding templates via a theme
Template structure & Overriding templates via a theme | WooCommerce developer docs
The various template files on your WooCommerce site can be found via an FTP client or your hosts file manager, in /wp-content/plugins/woocommerce/templates/. Alternatively, you can find the template files on our repository on GitHub.
🌐
WooCommerce
woocommerce.com › documentation › store design › woocommerce store editing › templates
Templates Documentation - WooCommerce
February 25, 2025 - Developers: If you’d like to override the default WooCommerce block templates in your custom block theme, please place your customized versions of these templates within your theme’s /templates directory. Review the WooCommerce block template files in GitHub.
🌐
WooCommerce Developer
developer.woocommerce.com › classic theme development › fix outdated templates
How to fix outdated WooCommerce templates | WooCommerce developer docs
Copy the default template from wp-content/plugins/woocommerce/templates/[path-to-the-template] and paste it in your theme folder found at wp-content/themes/[path-to-theme]. Open the template you pasted into the theme folder with a text editor, such as Sublime, Visual Code, BBEdit, Notepad++, and replicate any changes that you had to the previous template in your new, updated template file.
Top answer
1 of 3
17

The WooCommerce template files are different from the WordPress Template files look at this to see how it works and the template file for shop pages is archive-product.php

Usually, all themes provide a separate sidebar area for the shop page, did you check if your theme is compatible with WooCommerce?
If yes then you should have a sidebar available under Appearance->Widgets with name similar to 'Shop Sidebar'

How to override a template?

To override the shop page,
copy: wp-content/plugins/woocommerce/templates/archive-product.php
to wp-content/themes/your_theme_name/woocommerce/archive-product.php

and then make the necessary changes to the template in your themes folder.

What happens is WooCommerce checks for the archive-product.php file in theme directory first and if it finds a file in woocommerce/ directory then it will use that file instead of the default one.
So now you have to edit the file inside your_theme_folder/woocommerce to make any changes.

2 of 3
11

If you are using custom WooCommerce template overrides in your theme you need to declare WooCommerce support using the add_theme_support function. WooCommerce template overrides are only enabled on themes that declare WooCommerce support. If you do not declare WooCommerce support in your theme, WooCommerce will assume the theme is not designed for WooCommerce compatibility and will use shortcode-based unsupported theme rendering to display the shop.

Declaring WooCommerce support is straightforward and involves adding one function in your theme's functions.php file.

function mytheme_add_woocommerce_support() {
    add_theme_support( 'woocommerce' );
}
add_action( 'after_setup_theme', 'mytheme_add_woocommerce_support' );

Now override the template file copy: wp-content/plugins/woocommerce/templates/archive-product.php to wp-content/themes/your_theme_name/woocommerce/archive-product.php

🌐
WooCommerce
woocommerce.com › documentation › code snippets › template structure & overriding templates via a theme
Template structure & Overriding templates via a theme Documentation - WooCommerce
August 21, 2024 - The various template files on your WooCommerce site can be found via an FTP client or your hosts file manager, in /wp-content/plugins/woocommerce/templates/. Below are links to the current and earlier versions of the WooCommerce template files on Github, where you can view the code exactly as it appears in those files:
🌐
QuadLayers
quadlayers.com › home › blog › how to customize woocommerce templates
How to Customize WooCommerce Templates - QuadLayers
August 28, 2021 - You should overwrite your templates when you want to make complex customizations as it gives you more flexibility than hooks. The process is very similar to that of editing the functions.php file. In this case, you will edit the main WooCommerce template files instead of customizing the theme files.
🌐
WooCommerce
woocommerce.com › automatewoo › documentation › automatewoo › refer a friend › template files
Template files Documentation - WooCommerce
January 28, 2025 - Template files contain the markup for the frontend views and HTML emails in Refer A Friend. All of these templates can be customized by overriding one or more files in your theme.
Find elsewhere
🌐
Users Insights
usersinsights.com › home › overriding the woocommerce template files: step by step guide
Overriding the WooCommerce template files: Step by step guide - Users Insights
July 22, 2024 - You can find it under /wp-content/plugins/woocommerce/templates. The only exception for a theme file that is loaded outside the /woocommerce folder is the woocommerce.php file. Which is a file you add in your theme’s root folder for older WooCommerce versions for a quick WooCommerce fix.
🌐
WPVibes
wpvibes.com › home › a simple guide to override woocommerce templates
How to Override WooCommerce Templates Complete Guide
August 5, 2024 - For example, if you want to customize the price display on product pages, locate price.php under /wp-content/plugins/woocommerce/templates/single-product/. ... Then, copy the price.php file and create a similar folder structure in your child theme directory, like /wp-content/themes/your_theme_name/woocommerce/single-product/. Paste the price.php file into this new folder.
🌐
Codeable
codeable.io › home › codeable blog › customizing the woocommerce shop template
Customizing the WooCommerce shop template - Codeable
August 1, 2025 - The default WooCommerce shop template is archive-product.php, located in wp-content/plugins/woocommerce/templates/. To customize it, copy the file into your theme’s woocommerce folder.
🌐
GitHub
github.com › woocommerce › woocommerce › blob › trunk › plugins › woocommerce › templates › single-product.php
woocommerce/plugins/woocommerce/templates/single-product.php at trunk · woocommerce/woocommerce
A customizable, open-source ecommerce platform built on WordPress. Build any commerce solution you can imagine. - woocommerce/plugins/woocommerce/templates/single-product.php at trunk · woocommerce/woocommerce
Author   woocommerce
Top answer
1 of 4
4

WooCommerce uses the template_include filter/hook to load main templates like archive-product.php and single-product.php. And here's the class which handles main templates.

And there's a filter in that class which you can use to capture the default file (name) which WooCommerce loads based on the current request/page — e.g. single-product.php for single product pages.

You can't, however, simply hook to that filter, return a custom template path and expect it to be used (because the path has to be relative to the active theme folder). But you can do something like in the second snippet below (which is tried & tested working on WordPress 5.2.2 with WooCommerce 3.6.5, the latest version as of writing):

  1. First, a helper function:

    // Helper function to load a WooCommerce template or template part file from the
    // active theme or a plugin folder.
    function my_load_wc_template_file( $template_name ) {
        // Check theme folder first - e.g. wp-content/themes/my-theme/woocommerce.
        $file = get_stylesheet_directory() . '/woocommerce/' . $template_name;
        if ( @file_exists( $file ) ) {
            return $file;
        }
    
        // Now check plugin folder - e.g. wp-content/plugins/my-plugin/woocommerce.
        $file = 'full/path/to/your/plugin/' . 'woocommerce/' . $template_name;
        if ( @file_exists( $file ) ) {
            return $file;
        }
    }
    
  2. To override main WooCommerce templates (e.g. single-product.php):

    add_filter( 'woocommerce_template_loader_files', function( $templates, $template_name ){
        // Capture/cache the $template_name which is a file name like single-product.php
        wp_cache_set( 'my_wc_main_template', $template_name ); // cache the template name
        return $templates;
    }, 10, 2 );
    
    add_filter( 'template_include', function( $template ){
        if ( $template_name = wp_cache_get( 'my_wc_main_template' ) ) {
            wp_cache_delete( 'my_wc_main_template' ); // delete the cache
            if ( $file = my_load_wc_template_file( $template_name ) ) {
                return $file;
            }
        }
        return $template;
    }, 11 );
    
  3. To override WooCommerce template parts (retrieved using wc_get_template_part()):

    add_filter( 'wc_get_template_part', function( $template, $slug, $name ){
        $file = my_load_wc_template_file( "{$slug}-{$name}.php" );
        return $file ? $file : $template;
    }, 10, 3 );
    
  4. To override other WooCommerce templates (retrieved using wc_get_template() or wc_locate_template()):

    add_filter( 'woocommerce_locate_template', function( $template, $template_name ){
        $file = my_load_wc_template_file( $template_name );
        return $file ? $file : $template;
    }, 10, 2 );
    

Btw, there's also the woocommerce_template_path filter for those of you who're just looking to change the default WooCommerce templates folder (woocommerce) in the active theme folder.

2 of 4
3
function woo_template_replace( $located, $template_name, $args, $template_path, $default_path ) {

if( file_exists( plugin_dir_path(__FILE__) . 'templates/' . $template_name ) ) {
    $located = plugin_dir_path(__FILE__) . 'templates/' . $template_name;
}

return $located;
}


function woo_get_template_part( $template , $slug , $name ) {

if( empty( $name ) ) {
    if( file_exists( plugin_dir_path(__FILE__) . "/templates/{$slug}.php" ) ) {
        $template = plugin_dir_path(__FILE__) . "/templates/{$slug}.php";
    }
} else {
    if( file_exists( plugin_dir_path(__FILE__) . "/templates/{$slug}-{$name}.php" ) ) {
        $template = plugin_dir_path(__FILE__) . "/templates/{$slug}-{$name}.php";
    }
return $template;
}

add_filter( 'wc_get_template' , 'woo_template_replace' , 10 , 5 );

add_filter( 'wc_get_template_part' , 'woo_get_template_part' , 10 , 3 );

You can use this snippet in your plugin root file and place your all woocommerce templates file in templates directory.

Plugin structure for reference

plugins
  woo-template-replace (plugin root folder)
     woo-template-replace.php (plugin root file)
     templates (folder)
        single-content.php (woocommerce template file)
        searchform.php (woocommerce template file)
🌐
GoDaddy
godaddy.com › resources › skills › commerce › how to override woocommerce template files and woocommerce extensions
How to Override WooCommerce Template Files and WooCommerce extensions - GoDaddy Blog
April 16, 2024 - As an example, lets override the price template for the single product page to add a notice. First we locate the template file in question at: woocommerce/templates/single-product/price.php (see the full list of templates).
🌐
Webkul
webkul.com › home › how to create and customize woocommerce templates?
How to Create and Customize WooCommerce Templates Themes?
August 21, 2024 - Place your translation files in the /wp-content/themes/your-theme/languages/ folder and name them using the appropriate locale code (e.g., en_US.mo for American English). ... In your custom templates, replace static text with translation functions provided by WordPress and WooCommerce.
🌐
SiteOrigin
siteorigin.com › home › siteorigin premium documentation › plugin addons › woocommerce templates
WooCommerce Templates - SiteOrigin
August 17, 2024 - Once activated, go to SiteOriginWooCommerce Template Builder. Go to SiteOrigin > WooCommerce Template Builder to begin.
🌐
WooCommerce Developer
developer.woocommerce.com › classic theme development
Classic theme development handbook | WooCommerce developer docs
While an easy catch-all solution, it does have a drawback in that this template is used for all WooCommerce taxonomies (product categories, etc.) and post types (product archives, single product pages). Developers are encouraged to use the hooks instead (see below). ... Duplicate page.php: Duplicate your theme's page.php file, and name it woocommerce.php.
🌐
Beaver Builder
community.wpbeaverbuilder.com › beaver builder
Woocommerce template files - Beaver Builder - Beaver Builder Community Forum
May 12, 2015 - Hi I am looking to use Reciptful’s Recommendations service. To do so I need to edit the Woocommerce template files to remove the Related Products section and the You May Also Like section. And use their embedded code. Adii Pienaar has looked at the theme for me but he can’t see these files ...