How to Disable the DataTables Search Filter

When using the DataTables Extension, Views are displayed with a search input (red outline) provided by the DataTables script. You may not want both of these enabled if you are also using the GravityView Search Bar (blue outline).

Screenshot of the View showing two search inputs
To disable the DataTables built-in search input, use the code snippet below:

add_filter( 'gravityview_datatables_js_options', function( $config ) {

  $config['searching'] = false;

  return $config;
}, 20 );

Read here how to add these code samples to your website: Where to put code samples.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us