Website Building » WooCommerce » How Do I Change the Number of Columns in WooCommerce?

How Do I Change the Number of Columns in WooCommerce?

Last updated on January 19, 2023 @ 2:35 pm

There are a few ways that you can change the number of columns in WooCommerce. One way is to go to the WordPress Dashboard and navigate to Appearance > Customize > WooCommerce > Product Catalog. Here, you will find the option to change the number of columns under the “Product Catalog” heading.

Another way to change the number of columns is by adding a bit of code to your WordPress functions.php file. You can add this code by going to Appearance > Editor and selecting the functions.php file from the list on the right hand side. Once you have found the functions.php file, scroll down to the bottom and add this code:

<?php
function my_custom_wc_columns() {
return 4;
}
add_filter( 'loop_shop_columns', 'my_custom_wc_columns', 1, 10 );
?>

This will change the number of columns to 4. You can change the number 4 to whatever number of columns you want.

Once you have added this code, be sure to click “Update File” at the bottom of the page.

PRO TIP: If you are considering changing the number of columns in WooCommerce, be aware that this may adversely affect the layout of your store. Proceed with caution, and be sure to thoroughly test your changes before making them live.
Drew Clemente

Drew Clemente

Devops & Sysadmin engineer. I basically build infrastructure online.