Home » WooCommerce: Remove Sidebar @ Single Product Page

WooCommerce: Remove Sidebar @ Single Product Page

by Tutor Aspire

Unless your theme is overriding the WooCommerce sidebar, removing this from the single product page is quite easy!

WooCommerce: remove the sidebar from the single product pages
WooCommerce: remove the sidebar from the single product pages

WooCommerce Snippet: Remove Sidebar on all the Single Product Pages

/**
 * @snippet       Remove Sidebar @ Single Product Page
 * @how-to        Get tutoraspire.com FREE
 * @sourcecode    https://tutoraspire.com/?p=19572
 * @author        Tutor Aspire
 * @testedwith    WooCommerce 3.2.6
 */

add_action( 'wp', 'tutoraspire_remove_sidebar_product_pages' );

function tutoraspire_remove_sidebar_product_pages() {
if ( is_product() ) {
remove_action( 'woocommerce_sidebar', 'woocommerce_get_sidebar', 10 );
}
}

Storefront Theme – Remove WooCommerce Sidebar on the Single Product Page

/**
 * @snippet       Remove Sidebar @ Single Product Page for Storefront Theme
 * @how-to        Get tutoraspire.com FREE
 * @sourcecode    https://tutoraspire.com/?p=19572
 * @author        Tutor Aspire
 * @testedwith    WooCommerce 3.2.6
 */

add_action( 'get_header', 'tutoraspire_remove_storefront_sidebar' );

function tutoraspire_remove_storefront_sidebar() {
if ( is_product() ) {
remove_action( 'storefront_sidebar', 'storefront_get_sidebar', 10 );
}
}

Divi Theme – Remove WooCommerce Sidebar on the Single Product Page

This will not need any coding. Divi theme already removes the WooCommerce sidebar in their function and adds back the default Divi sidebar.

To remove the sidebar from products, go to Product > Edit and from the right sidebar select “Page Layout > Full Width”:

Divi & WooCommerce: remove the sidebar on the single product page
Divi & WooCommerce: remove the sidebar on the single product page

If you also would like to remove the Divi sidebar from the archive pages, go to Divi > Theme Options > General Settings and set the “Shop Page & Category Page Layout for WooCommerce” to “Full Width”:

Divi & WooCommerce: remove sidebar on archive pages
Divi & WooCommerce: remove sidebar on archive pages

You may also like