Here are easy steps to add a search bar to a 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

How to add searchbox to wordpress websites

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.

how to add search bar in wordpress header

How to add a custom search box in WordPress?

  1. Login to your WordPress admin panel.
  2. Go to Appearance->editorhow to add search bar in wordpress header
  3. Add the following code to the header.php file.
    <?php get_search_form(); ?>

    how to add search bar in wordpress header

  4. This will bring in searchform.php if it is present in your theme.
  5. 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.
  6. Signup for a free search demo by entering your URL.
  7. This will build a search demo.
  8. Download and Install ExpertRec’s WordPress search plugin from here which will replace your default search form with that of Expertrec’s hosted search.
  9. Copy-paste your API key from your ExpertRec’s control to add search bar in wordpress header
  10. Your new search engine is ready for use.
  11. If you like to change the ranking or the UI, you can do them easily in your control panel.
  12. If the plugin method didn’t work, go to the code section inside your WordPress admin panel and add it to your WordPress PHP code. You could also email the code to your WordPress developer to get this added to your site. The <ci-search><ci-search> tag will add the search bar in WordPress header whereas the code within <script></script> adds the search functionality (autocomplete, spell correct, image search etc)custom search box wordpress
  13. You can edit the look and feel of your WordPress custom search box by going to and change the attributes without the need for coding.Custom search form wordpress plugin
  14. The custom search box for WordPress looks similar to the image belowcustom search box wordpress

Add Custom Search to your website

Muthali loves writing about emerging technologies and easy solutions for complex tech issues. You can reach out to him through chat or by raising a support ticket on the left hand side of the page.

You may also like