To remove the <div class="woocommerce"> container div from your WooCommerce pages, you can use the following steps:

  1. Create a child theme for your WooCommerce site. This ensures that any customizations you make will not be overwritten when the parent theme or WooCommerce plugin is updated.
  2. In your child theme, create a new folder called “woocommerce” and within that, create a new file called “content-wrapper-start.php”
  3. In content-wrapper-start.php, copy and paste the following code snippet:
Copy code<?php
if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly
}
  1. Now, you need to find the location where the content-wrapper-start.php is being called in the woocommerce template files. This location will vary based on your theme, but it is typically located in the templates/global/wrapper-start.php or templates/global/content-wrapper-start.php file.
  2. Once you find the location, you can remove the div container class ‘woocommerce’ from the div

It’s worth noting that this will remove the container class from all WooCommerce pages, so if you want to remove the container class only from a specific page, you will need to use conditional tags to target that specific page.

Please be aware that modifying the core files of the plugin or theme may cause issues when you update them. So it’s always recommended to use a child theme or custom plugin to add customizations.

(Visited 43 times, 1 visits today)
Was this article helpful?
YesNo
Close Search Window