Add a search form in a page or template part

<?php get_search_form(); ?>

Alternatively you can add a basic search form using the Gutenberg search block and modify the label, placeholder and search button

Search results

The search.php file will serve the results, using the text entered in the form it will search through your site to find with either the word or phrase in the title or content of those posts or pages.

Customise the search form

To modify the default search form you can add searchform.php to the route of the theme folder. This file should contain a label and the text field should have the name=”s”. Example:

<form role="search" method="get" action="<?php bloginfo('url'); ?>" class="wp-block-search__button-outside wp-block-search__text-button wp-block-search">
	<label for="wp-block-search__input-1" class="wp-block-search__label">Search the site</label>
	<div class="wp-block-search__inside-wrapper ">
		<input type="search" id="wp-block-search__input-1" class="wp-block-search__input " name="s" value="" placeholder="" required="">
        <button type="submit" class="wp-block-search__button  ">Search this site</button>
	</div>				
</form> 

Search the site


Address

123 Main Street
Town
City
P05T C0D3

Tel: 01234 567 899

Mob: 01234 567 899

Email: ben@gomopress.com


Copyright 2023. Blah blah blah Company Limited