Bookmark

No account yet? Register

Difficulty: Easy

Here we will cover how to reorder product tabs on the product page in your Woo commerce store. Reordering the product tabs is very simple and can be done like many other things on your Woo Commerce store by adding code to your Functions.php file in your theme folder.

TLDR
File: Functions.php

add_filter( 'woocommerce_product_tabs', 'woo_reorder_tabs', 98 );
function woo_reorder_tabs( $tabs ) {
     $tabs['reviews']['priority'] = 5; // Reviews first
     $tabs['description']['priority'] = 10; // Description second
     $tabs['additional_information']['priority'] = 15; // Additional information third

return $tabs;
}

Reordering product tabs

Customizing functions.php file in WordPress

To reorder product tabs first navigate to your admin interface and then go to Appearance and then under Appearance select Theme Editor.

After navigating there you will see a window like this one below. In there select your child theme and then under Theme Functions (functions.php) put this code at the end.

add_filter( 'woocommerce_product_tabs', 'woo_reorder_tabs', 98 );
function woo_reorder_tabs( $tabs ) {
     $tabs['reviews']['priority'] = 5; // Reviews first
     $tabs['description']['priority'] = 10; // Description second
     $tabs['additional_information']['priority'] = 15; // Additional information third

return $tabs;
}
This image has an empty alt attribute; its file name is image-1-1024x483.png

Click on the button below to update your file/save changes and that’s it. Now your product tabs will be reordered like this: 1. Reviews/2. Description/3.Additional information.

Editing the code

There are a few possibilities on how you can edit this code to fit your purpose. Maybe you want diffrent order of tabs. Maybe you want additional information to be first and then reviews and at the end Description. Accomplishing that it’s very easy.

Custom order of tabs

To change the order of tabs to suit your need, you just need to change its priority. Let’s say we want an order like this: 1.Additional information/2.Description/3.Reviews. We would simply change Additional information priority to 5, Description priority to 10 and reviews priority to 15. Here is a code example.

add_filter( 'woocommerce_product_tabs', 'woo_reorder_tabs', 98 );
function woo_reorder_tabs( $tabs ) {
     $tabs['additional_information']['priority'] = 5; // Additional information    first
     $tabs['description']['priority'] = 10; // Description second
     $tabs['reviews']['priority'] = 15; // Reviews third

return $tabs;
}

You can accomplish any order you want simply by changing priority.

Write A Comment