1. Posts Table Pro
  2. Advanced Usage

How to disable sorting in Posts Table Pro

If you want to disable sorting for individual columns in your Posts Table Pro tables, please see the posts_table_column_sortable hook in the Developer Documentation.

If you want to completely disable column sorting in the table, you can use the following code. Add it to a custom plugin or inside your theme's functions.php file:

Please note: this will completely disable the ability to sort the table, and means the sort_by option can no longer be used. If you need to use this option then we recommend using the posts_table_column_sortable hook.

// Disable column sorting
add_filter( 'posts_table_data_config', function( $config ) {
    $config['ordering'] = false;
    return $config;
} );

Related Articles

If searching the knowledge base hasn't answered your question, please contact support.