How to remove Twenty Eleven Search Form from Header

Twenty Eleven search form box and Twenty Ten?

If your blog is currently using WP 3.2′s Twenty Eleven theme, you will notice it has search box in the header part of the theme’s layout.

What I really like is the Twenty Eleven search form is actually placed on right in the header’s right part, which most of people want to implement into Twenty Ten theme.

In the past on Twenty Ten theme, in that part of its header were site description.

Now it looks like wordpress developer want to make use of the theme optimally, by placing that box, so when your visitor needs to search on something in your post, they can easily type in something in that box.

Now Twenty Eleven search form is in the header

From now on, we have a default theme that has the search box in the header part as we always wanted, but some of us want to remove it.

It can be many reasons why we want to remove that Twenty Eleven search box, it can be that they do not like the looks of it, or it could be they already have search form in their wordpress widgets, and then to avoid having multiple search boxes in one page that surely confuses their reader, they might want to remove the header’s search box and use the widget instead.

It actually reminds me of one of my readers some months ago, that asked where they could find my search box, because they really need it especially when we have a blog which contains hundreds of posts to find a specific content easily.

From that email, I realized that replacement of our search boxes are really important, because when we put it on a hidden space or a place where it is mixed up with other widgets, our visitors can barely find it.

This means, we have less usability of our content.

So how do I remove Twenty Eleven Search form box?

Twenty eleven search box code is actually placed in header.php.

But in this tutorial, we are using Twenty Eleven child theme, and then copy and editing the original header.php inside the child theme.

Video Tutorial


Steps:

1. I assume you are now using the child theme, if you haven’t done so, please see this child theme tutorial.

2. Open the original Twenty Eleven theme folder, and look for header.php. After that, copy that file into the child theme folder.

3. Once it is copied, open it with text editor, in the video, I edited the file directly from my cPanel file editor.

4. Inside the header.php, look for this line:

<?php
// Has the text been hidden?
if ( 'blank' == get_header_textcolor() ) :
?>
<div>
<?php get_search_form(); ?>
</div>
<?php
else :
?>
<?php get_search_form(); ?>
<?php endif; ?>

If you use cPanel code editor, it is about in line 98-100.

5. Now, you have two options, either to delete those lines, or commenting them out.

After commenting them out:

<!--
<?php
// Has the text been hidden?
if ( 'blank' == get_header_textcolor() ) :
?>
<div>
<?php get_search_form(); ?>
</div>
<?php
else :
?>
<?php get_search_form(); ?>
<?php endif; ?>
-->

Screenshot:

twenty eleven search

The line of Search Box codes

The difference is, it has “commented” code.

I would personally comment them out, because if one day, you want to have the box back, you can just easily removing the comments, and will easily place back the box.

If you delete them, it will be possible to place the box back, but then you will have to look in the original theme files again, which is not bad, but less practical than when you comments the code out.

6. Don’t forget to save the changes in your file, and refresh your browser.

So I did remove Twenty Eleven search form box, by commenting the search form code.

Comments

  1. says

    Thanks Kimmie!! This helped me get rid of my searchbox. I am LOVING your videos they are sooooo helpful for a new blogger like myself. Please keep making these helpful videos with accompanied posts.

    • says

      Hello MissFancye!!

      Welcome to my blog:)

      I am glad you found the videos are helpful, and thank you sooooooooo much for the nice words.

      Also thanks for coming accross and leaving a comment!

      Good luck with your blog

      Kind regards
      Kimi.

  2. Dan says

    Thank you very much Kimi from saving my hair from getting pulled out, your tutorial was more informative than i was expecting. You could even split this one video into three mini tutorials. How to use file manager in host gator. How to assemble a child theme. How to comment out/disable the search box. Your a great teacher.

    Cheers

    • says

      Hi Dan!

      Welcome to my blog, splitting one video into mini tutorials is a brill idea, never thought about this before!

      Thank you for this, and also for your nice words.

      Best wishes

      Kimi

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">