How to remove the default search box in WordPress blog

Share This Post

Sometime ago i wrote on “How to remove the navbar in a blogger blogspot blog” but today i will be writing on how to remove the default search box in WordPress blog. If you are a WordPress user, the default search box may be of good use to you, but it won’t hurt if you also earn from search activities from your blog. So today I am ging to teach you how you can remove the default search box from your WordPress theme and replace it with a Google search for adsense that can fetch you money when visitors use it to search for something in your site.

NOTE: The default search box in WordPress is dependent of the type of theme, so they may not be in same file as the example I may give. I am using a TechMaish theme and the search box is on a file called Sidebar (Sidebar.php). I have heard of cases where the search box is on a footer.php file. So you must be able to identify the file that contains the search box script.

Remember to backup any file before tampering with it, that way if you make a mistake you can restore your file from the backup.

How to remove the default search box in WordPress blog

In my case this is the sidebar.php file, if you see very well the search box is on an inbuilt widget of my theme. So follow my simple instructions to remove the search box from your WordPress blog.

How to remove the Search Box from my WordPress blog: 
1.  Login to your WordPress Dashboard through the www.yourdomain.com/wp-admin/

2. On the left hand side of the Dashboard, click on Appearance

3. Next click on Editor

4. Choose the Sidebar.php file (or any file containing your search box script)

<div id=”sidebar”>
<div class=”sidebar-wrap”>

<div class=”wide-widget”>
<h2>Search</h2>
<?php include (TEMPLATEPATH . ‘/searchform.php’); ?>
</div>

<?php $tm_check125 = get_option(‘tm_check125′); if($tm_check125): ?>
<div id=”ads-box”>
<a href=”<?php $tm_ad1link = get_option(‘tm_ad1link’); echo stripslashes($tm_ad1link); ?>” rel=”nofollow” target=”_blank”><img
src=”<?php $tm_ad1path = get_option(‘tm_ad1path’); echo stripslashes($tm_ad1path); ?>” alt=”advertisment” width=”125″ height=”125″/></a>
<a href=”<?php $tm_ad2link = get_option(‘tm_ad2link’); echo stripslashes($tm_ad2link); ?>” rel=”nofollow” target=”_blank”><img
src=”<?php $tm_ad2path = get_option(‘tm_ad2path’); echo stripslashes($tm_ad2path); ?>” alt=”advertisment” width=”125″ height=”125″/></a>
<a href=”<?php $tm_ad3link = get_option(‘tm_ad3link’); echo stripslashes($tm_ad3link); ?>” rel=”nofollow” target=”_blank”><img
src=”<?php $tm_ad3path = get_option(‘tm_ad3path’); echo stripslashes($tm_ad3path); ?>” alt=”advertisment” width=”125″ height=”125″/></a>
<a href=”<?php $tm_ad4link = get_option(‘tm_ad4link’); echo stripslashes($tm_ad4link); ?>” rel=”nofollow” target=”_blank”><img
src=”<?php $tm_ad4path = get_option(‘tm_ad4path’); echo stripslashes($tm_ad4path); ?>” alt=”advertisment” width=”125″ height=”125″/></a>
</div> <!– #ads-box–>
<?php endif; ?>

<?php /* Widgetized sidebar, if you have the plugin installed. */
if ( !function_exists(‘dynamic_sidebar’) || !dynamic_sidebar(‘Sidebar’) ) : ?>
<?php endif; ?>
</div> <!– .sidebar-wrap –>
<div class=”clear”></div>
</div> <!– #sidebar –>

5. Delete the file in red as above.

6. Save your file

7. Check your WordPress blog on a browser to see if the search box has been removed or not.

I hope i have helped you today to remove the default search box from your WordPress blog. If you like my blog posts don’t forget to Subscribe to NetMediaBlog Feeds by Email. My next blog post will be how to add Google Search for adsense in place of the default search box in WordPress blog.


Comments

  1. woman apparel says

    Super-Duper blog! I am loving it!! Will be back later to read some more. I am bookmarking your feeds also

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> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>