WordPress.org

Support

Support » How-To and Troubleshooting » How to get rid of search bar in header?

How to get rid of search bar in header?

  • Hi there. I want to remove the search bar which is overlaid over my header on my site. I believe I know which code I need to remove from header.php to remove it, but I want to be sure before I go ahead and do so. Thanks for any help!

    Here is the link to my site: http://www.jakehuddleston.com

Viewing 3 replies - 1 through 3 (of 3 total)
  • Christine Rondeau

    @crondeau

    Volunteer Forum Moderator

    I think that you’ll want to remove the following:

    <div id="pao_search"><form role="search" method="get" id="searchform" action="http://www.jakehuddleston.com/" >
    	<div><label class="screen-reader-text" for="s">Search for:</label>
    	<input type="text" value="" name="s" id="s" />
    	<input type="submit" id="searchsubmit" value="Search" />
    	</div>
    	</form></div>

    or in your css, just add #pao_search {display:none;}

    By the way when you say this:

    I believe I know which code I need to remove from header.php to remove it, but I want to be sure before I go ahead and do so. Thanks for any help!

    I would recommend that you make a back up of your theme, make changes and then if something breaks just re-upload the back up. It’s by breaking things that you learn. 🙂

    Thanks Christine, I am new to WordPress and coding in general so I will definitely start to ‘experiment’ with changing code to see what works.

    Unfortunately I can’t seem to find the code that you said to remove…is it in the style.css or in header.php? Thanks!

    Christine Rondeau

    @crondeau

    Volunteer Forum Moderator

    Header.php line 61.

    Look for pao_search

    The code in the php is slightly different and looks like so:

    <div id="pao_search"><?php get_search_form(); ?></div>

    The get_search_form function is a WordPress function that generates the search form. 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to get rid of search bar in header?’ is closed to new replies.
Skip to toolbar