Here are easy steps to add a search bar to WordPress header. Using the search bar, your site visitors can find what they need in a moment. This post will help you create a search bar in your WordPress site
In most of the WordPress themes, a search box is included by default. But if any theme doesn’t have it or you want to make your own custom search box, you can easily do that too.
- Go to Appearence->editor
- Add the following code to the header.php file.
<?php get_search_form(); ?>
- This will bring in searchform.php if it is present in your theme.
- This will bring the default search that is built-in WordPress to appear in the header. The quality of this search is not great. Continue to read to build a better and faster search experience.
- Signup for a free search demo by entering your url.
- This will build a search demo.
- Download and Install ExpertRec’s WordPress search plugin from here which will replace your default search form with that of Expertrec’s hosted search.
- Copy-paste your API key from your ExpertRec’s control panel.
- Your new search engine is ready for use.
- If you like to change the ranking or the UI, you can do them easily in your control panel.