Title: searchform.php
Last modified: August 19, 2016

---

# searchform.php

 *  Resolved [pcr1066](https://wordpress.org/support/users/pcr1066/)
 * (@pcr1066)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/searchformphp/)
 * Please can anyone explain where the code is for the search form that appears 
   at the top of the sidebar.
 * I have tried searching in the default theme and the classic theme, in fact I 
   searched the full WordPress folder but was unable to find any file called “searchform.
   php”.
 * Further, I have spent some considerable time searching the internet for help 
   regarding customising of the search form. Every post I have come across mentions
   editing the “searchform.php” file.
 * Clearly, in WordPress 2.8.4 the file has been removed from the default and classic
   themes, but where is it?
 * The form must be contained within another file somewhere in the WordPress folder.

Viewing 5 replies - 1 through 5 (of 5 total)

 *  [Samuel B](https://wordpress.org/support/users/samboll/)
 * (@samboll)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/searchformphp/#post-1189794)
 * `searchform.php`
    comes with the default theme – really
 *  Thread Starter [pcr1066](https://wordpress.org/support/users/pcr1066/)
 * (@pcr1066)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/searchformphp/#post-1190092)
 * Thank you for the reply Sambol, but no it is not in the default, or classic, 
   themes. So many have siad this but it is simply not true!
 * Download the latest copy and do a search, you will not find any file called “
   searchform.php” with the installation files.
 * I had the same type of problem with a module for Drupal (Categories). In the 
   end it turned out that the author had forgotten to add the file. Looks like WordPress
   may have done the some in their latest release! (Or this was intentional!)
 * I have solved this however by downloading another theme. Had todownload a few
   before I found one that contained the file. I was then able to add this to my
   own theme and customise (Yes it is spelt c.u.s.t.o.m.i.S.e – Sorry one of my 
   pet hates!) accordingly.
 * Finally thanks for your quick reply to my query, and thanks for
 *  [klnh13](https://wordpress.org/support/users/klnh13/)
 * (@klnh13)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/searchformphp/#post-1190264)
 * Hey I encountered the same problem.
 * I installed WordPress about a week ago, and it’s true. There is definitely no
   searchform.php file in the default theme.
 * The strange part is that there’s virtually nothing written anywhere about why
   it’s missing or what it contained. I solved the problem pretty much the same 
   way, borrowing the file from someone else’s theme.
 * It was included in the source files of this great WordPress themebuilding tutorial:
   **
   webdesignerwall.com/tutorials/building-custom-wordpress-theme**
 * For anyone else who is in need of it, simply copy the following text into your
   text editor and save it as searchform.php.
 *     ```
       <form method="get" id="searchform" action="<?php bloginfo('url'); ?>/">
       	<label class="hidden" for="s"><?php _e('Search:'); ?></label>
       	<input type="text" value="<?php the_search_query(); ?>" name="s" id="s" />
       	<input type="submit" id="searchsubmit" value="GO" />
       </form>
       ```
   
 *  [Mark / t31os](https://wordpress.org/support/users/t31os_/)
 * (@t31os_)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/searchformphp/#post-1190265)
 * Examples/default-code can be seen on the following Codex page.
    [http://codex.wordpress.org/Function_Reference/get_search_form](http://codex.wordpress.org/Function_Reference/get_search_form)
 *  [82design](https://wordpress.org/support/users/82design/)
 * (@82design)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/searchformphp/#post-1190272)
 * Strange… I have been working with WP for a while as well… and poof… no searchform.
   php standard in classic and default… However, it is in the wp-include folder 
   around line 124 inside the general-template.php file…
 * Look for
 *     ```
       $form = '<form role="search" method="get" id="searchform" action="' . get_option('home') . '/" >
       	<div><label class="screen-reader-text" for="s">' . __('Search for:') . '</label>
       	<input type="text" value="' . esc_attr(apply_filters('the_search_query', get_search_query())) . '" name="s" id="s" />
       	<input type="submit" id="searchsubmit" value="'. esc_attr__('Search') .'" />
       	</div>
       	</form>';
       ```
   

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘searchform.php’ is closed to new replies.

## Tags

 * [forms](https://wordpress.org/support/topic-tag/forms/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 5 replies
 * 5 participants
 * Last reply from: [82design](https://wordpress.org/support/users/82design/)
 * Last activity: [16 years, 1 month ago](https://wordpress.org/support/topic/searchformphp/#post-1190272)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
