Enable Search Field Labels

Example of Availability Search for WooCommerce Bookings with Search Labels
Availability Search for WooCommerce Bookings with Search Labels

Are you using a lot of filters for your Availability Search? You should consider enabling lables for the search filters. The labels will help your customers navigate the search and find what they are looking for.

Search labels can be enabled from the Availability Search settings.

Screenshot of enabling field lables in Availability Search for WooCommerce Bookings
Enable ‘Display Filter Labels’

Customizing The Search Labels

You can use this code snippet to customize the label text. Apply it within your child theme’s function.php or a custom plugin (preferred method).

Keep in mind that custom taxonomy lables are automatically displayed as their taxonomy name. You’ll have to change the taxonomies directly to alter how they display.


function puri_change_search_strings( $labels ) {

	$labels['taxonomy_default']    = 'Any'; // No tax selected.
	$labels['category_default']    = 'Any'; // No categories selected.
	$labels['categories']          = 'Categories'; // Category Label
	$labels['datepicker']          = 'Dates'; // Date Picker Label.
	$labels['keyword']             = 'Keyword'; // Keyword Label.
	$labels['keyword_placeholder'] = 'Keyword'; // Keyword PLaceholder.
	$labels['search']              = 'Search'; // Search Button.

	return $labels;
}

add_filter( 'aswb_filter_search_strings', 'puri_change_search_strings' );
Code language: PHP (php)
Was this page helpful?