Change column order

Follow these instructions to customize the column order:

1. Download the free Code Snippets plugin https://wordpress.org/plugins/code-snippets/
2. Create a new Snippet with the following code:

function pw_bulk_edit_custom_column_order( $columns ) {
    // Specify the order that you want the first columns to be in.
    //
    // NOTE: The column names must match what is on the screen exactly!
    //
    $new_order = array(
        'Product name',
        'Type',
        'Status',
        'Sale end date',
        'Sale price',
        // Everything else will appear in the original order after these columns
    );

    // You don't need to change anything below.
    $modified_columns = $columns;
    $first = array_fill( 0, count( $new_order ), '' );

    for ( $x = 0; $x < count( $columns ); $x++ ) {
        $custom_index = array_search( $columns[$x]['name'], $new_order );
        if ( $custom_index !== false ) {
            $first[ $custom_index ] = $columns[$x];
            unset( $modified_columns[$x] );
        }
    }

    return array_merge( $first, $modified_columns );
}
add_filter( 'pwbe_product_columns', 'pw_bulk_edit_custom_column_order', 11 );

3. Change the column order as needed.

Note: If you are more comfortable with editing your functions.php you can do that instead of Code Snippets.

If the results show column names with "1" as the header value, then you haven't matched the column name with what is displayed.

Skip to content