WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How to remove search bar from a wordpress theme?

share|improve this question
Where is the search bar located? In the sidebar, header, footer? Which theme are you using? – shea Dec 21 '12 at 20:29

If the search field is implemented as a widget, this can be done via the administration interface. Just navigate to Appearance > Widgets and drag the search widget from the widget area to the "Available Widgets" pane.

If the search field is hard-coded into the theme, it might be easier to edit the CSS rather than the HTML and PHP. Here's how:

  • Use Firebug or a similar tool to locate the DIV element containing the search code.
  • In the theme's CSS file (probably style.css), add display: none to that DIV. That's it!

This is a minimally invasive approach. If you ever want to re-enable the search bar, just remove the display: none statement from your CSS.

share|improve this answer
Thanks, it will be great idea. I am just going to implement it. – Himanshu Vyas Oct 10 '10 at 4:25
@kylan +1 for the CSS idea. This is especially great for child themes which are made of one file only: style.css. – ef2011 Feb 1 '12 at 15:04
  1. Try to locate the HTML representing the search bar.

  2. Then find in which theme files it resides (it may be defined in multiple files - single.php, page.php,..)

  3. Remove the markup including the php call from all the files.

share|improve this answer
Thanks for reply. I am going to try this. – Himanshu Vyas Oct 7 '10 at 12:52

You can find it at header.php and just delete it or use CSS attribute "display:none". get_search_form() method represents Search Bar.

// Has the text been hidden?
if ( 'blank' == get_header_textcolor() ) : ?>

    <div class="only-search<?php if ( $header_image ) : ?> with-image<?php endif; ?>">
    <?php get_search_form(); ?>
        else :
    <?php get_search_form(); ?>
<?php endif; ?>
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.