How to Hide search Box in wordpress ?

How to Hide search Box in wordpress ?

It may help, for your doubt.
Remove Following code from searchform.php  (1st Way)
<form method=”get” id=”searchform” action=”<?php bloginfo(‘url’); ?>”>
<div>
<label for=”s”>Keyword(s)</label> <input type=”text” value=”<?php if(trim(wp_specialchars($s,1))!=”) echo trim(wp_specialchars($s,1));else echo ‘ ‘;?>” name=”s” id=”s” />
<input type=”submit” name=”Submit” value=”Search!” />
</div>
</form>

But removing of code is not a good solutions. When you upgrade new version of wordpress, again you need to hide this code or remove this code. Instead of removing this code,another one idea is we will update search box – class in css (Good solution)

style.css : (2nd Way)
Appearance -> Editor -> style.css
Ex Code :
/* Search Form */
#branding #searchform {
position: absolute;
top: 3.8em;
right: 7.6%;
text-align: right;
display : none;        (add this code here)
}
Source : http://wordpress.org/support/topic/removing-search-for-text-from-search-box
3rd Way :
You can remove the “Search for:” text by editing (WP version 2.8) wp-includes\general-template.php

Line 125
<div><label for=”s”>’ . __(‘<!–Search for:–>’) . ‘</label>
I commented it out (as seen above) so it wouldn’t show. Hope that helps.
4th Way  :
In header.php at line no. 26 you’ll find below code
<?php include (TEMPLATEPATH . ‘/searchform.php’); ?>
here you want to remove this code ( or ) if you want to change the position, then paste above code wherever you want.
Note : You have to chmod with 777 the files that you want to change otherwise you will never change anything using wordpress html editor

Leave a Reply