How to Add a Search Box to Your WordPress Menu

Prem Tiwari - - WordPress, WordPress Snippets

This is a very short tutorial, which will demonstrate how to add a search box to your WordPress menu bar without using any WordPress plugin.

No need to install any plugin to add a search box to your menu bar, simply follow the below steps for the same.

How to add a search box to your WordPress menu

How to add a search box to your WordPress menu

Open the functions.php file and copy paste below code snippet at the end of the file and save it. Below code will automatically add the search box to your primary menu bar.

By default, it will be displayed as your theme color combination, but if you want to change the style, then you can add your custom styles to search box. In the example, I have added margin to search box from top and right.

About: Prem Tiwari

Prem Tiwari is the founder of and also a professional developer who has vast experience in PHP and open source technologies. Apart from this, he is a blogger by hobby and also he has been a regular speaker of WordPress sessions in various IT Companies.

Tags: , , , , , , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.