Skip to main content
Login Join
Snippet · PHP

Change WooCommerce Products Per Row

Shared by Amit Dholiya · September 9, 2026 · @loop_shop_columns

11 views
1 upvote
Back to Snippets

If you want to control how many products appear in each row on the WooCommerce shop/category pages, you can use the loop_shop_columns filter.

Steps

  1. Add the code below to your theme’s functions.php.
  2. Change 4 to the number of products you want per row.
  3. Save and refresh your Shop page.
/**
 * Change WooCommerce products per row
 */
function custom_woocommerce_products_per_row( $columns ) {
    return 4;
}

add_filter( 'loop_shop_columns', 'custom_woocommerce_products_per_row', 20 );
Know a different way to do this? Add your approach as a variation so folks can compare them side by side.
Submit a variation

0 comments