site_search_columns filter-hookWP 4.6.0

Filters the columns to search in a WP_Site_Query search.

The default columns include 'domain' and 'path.


add_filter( 'site_search_columns', 'wp_kama_site_search_columns_filter', 10, 3 );

 * Function for `site_search_columns` filter-hook.
 * @param string[]      $search_columns Array of column names to be searched.
 * @param string        $search         Text being searched.
 * @param WP_Site_Query $query          The current WP_Site_Query instance.
 * @return string[]
function wp_kama_site_search_columns_filter( $search_columns, $search, $query ){

	// filter...
	return $search_columns;
Array of column names to be searched.
Text being searched.
The current WP_Site_Query instance.


Since 4.6.0 Introduced.

Where the hook is called

wp-includes/class-wp-site-query.php 627
$search_columns = apply_filters( 'site_search_columns', $search_columns, $this->query_vars['search'], $this );

Where the hook is used in WordPress

Usage not found.