How can i filter number of orders per page in My Account?

By default, on WooCommerce My Account orders section shows 10 orders on each page. If you want to show more orders on each page, you need to use the woocommerce_my_account_my_orders_query filter hook like the one below:

function function_my_account_orders( $args ) {
    $args['posts_per_page'] = 15;// change the number 15 with your own
    return $args;
}
add_filter( 'woocommerce_my_account_my_orders_query', 'function_my_account_orders', 10, 1 );

You can use this filter hook for other purposes like order meta query, order status filter etc., by modifying the $args array.

Leave a Reply

Your email address will not be published. Required fields are marked *