Maximizing User Experience How to Remove Sidebar from Woocommerce Product Page

please click here for more wordpress cource

To remove the sidebar from the WooCommerce product page, you will need to make some changes to the template files or use a plugin. Here are the steps you can follow:

Option 1: Use a plugin

  1. Install and activate a plugin such as “WooCommerce Sidebar Removal” or “Remove WooCommerce Sidebar”.
  2. Go to the plugin’s settings page and choose the product page where you want to remove the sidebar.
  3. Save your changes, and the sidebar should be removed from the selected product page.

Option 2: Remove the sidebar manually

  1. Create a child theme for your WordPress site if you haven’t already done so.
  2. In the child theme, create a copy of the content-single-product.php file from the WooCommerce plugin.
  3. Open the copied file in a text editor.
  4. Look for the following code:
<div class="col2-set">
    <div class="col-1">
        <?php
        /**
         * woocommerce_single_product_summary hook
         *
         * @hooked woocommerce_template_single_title - 5
         * @hooked woocommerce_template_single_rating - 10
         * @hooked woocommerce_template_single_price - 10
         * @hooked woocommerce_template_single_excerpt - 20
         * @hooked woocommerce_template_single_add_to_cart - 30
         * @hooked woocommerce_template_single_meta - 40
         * @hooked woocommerce_template_single_sharing - 50
         * @hooked WC_Structured_Data::generate_product_data() - 60
         */
        do_action( 'woocommerce_single_product_summary' );
        ?>
    </div>
    <div class="col-2">
        <?php do_action( 'woocommerce_sidebar' ); ?>
    </div>
</div>

Delete the div element with the class col-2, which contains the sidebar. The code should now look like this:

<div class="col2-set">
    <div class="col-1">
        <?php
        /**
         * woocommerce_single_product_summary hook
         *
         * @hooked woocommerce_template_single_title - 5
         * @hooked woocommerce_template_single_rating - 10
         * @hooked woocommerce_template_single_price - 10
         * @hooked woocommerce_template_single_excerpt - 20
         * @hooked woocommerce_template_single_add_to_cart - 30
         * @hooked woocommerce_template_single_meta - 40
         * @hooked woocommerce_template_single_sharing - 50
         * @hooked WC_Structured_Data::generate_product_data() - 60
         */
        do_action( 'woocommerce_single_product_summary' );
        ?>
    </div>
</div>
  1. Save the file and upload it to your child theme directory.
  2. Refresh your product page, and the sidebar should be removed.

You may also like...

Popular Posts

Leave a Reply

Your email address will not be published. Required fields are marked *