How to replace WooCommerce product tabs with simple paragraphs

By default, WooCommerce product pages include tabs such as “Description,” “Additional Information,” and “Reviews.” If you want to remove these tabs and display their content as simple paragraphs within the page, you can do so with a few code adjustments.

Below, we show you how to achieve this with PHP examples.

 

Remove Default WooCommerce Tabs

WooCommerce allows modifying product tabs using the woocommerce_product_tabsfilter. To remove them, use the following code:

<?php
function removeProductTabs( $tabs ) {
    unset( $tabs['description'] );       // Remove the description tab
    unset( $tabs['additional_information'] ); // Remove the additional information tab
    unset( $tabs['reviews'] );           // Remove the reviews tab
    return $tabs;
}
add_filter( 'woocommerce_product_tabs', 'removeProductTabs' );

This code:

  • Retrieves the full product description and displays it as a paragraph on the page.
  • Fetches the product attributes and lists them as bullet points.

 

Display reviews as paragraphs

If you want to include reviews on the page without using a tab, use this code:

<?php
function displayProductReviews() {
    comments_template();
}
add_action( 'woocommerce_after_single_product_summary', 'displayProductReviews', 15 );

This inserts the reviews section at the bottom of the product page, right after the description.

With these adjustments, we have removed the default tabs and displayed product information in a simpler and more accessible format. This can enhance the user experience for certain WooCommerce store layouts.

If you want further customization, you can add CSS classes and styles to improve the presentation.

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Back to Top
0
Would love your thoughts, please comment.x
()
x