Title: Search Box
Last modified: August 20, 2016

---

# Search Box

 *  Resolved [shaquilleray](https://wordpress.org/support/users/shaquilleray/)
 * (@shaquilleray)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/search-box-4/)
 * Hey.
 * I’m trying to embed the WordPress search box on a page, I found that I needed
   to use PHP so I installed the “Allow PHP on Pages and Post” plugin and added 
   the code, however the search box doesn’t display!
 * I if i don’t use the plugin the search box appears however “<?php bloginfo(‘home’)’?
   >/”>” appears in the search box!
    itself
 * Code I am using is below
 *     ```
       <form method="get" id="searchform" action="<?php bloginfo('home'); ?>/">
       <div><input type="text" size="18" value="<?php echo wp_specialchars($s, 1); ?>" name="s" id="s" />
       <input type="submit" id="searchsubmit" value="Search" class="btn" />
       </div>
       </form>
       ```
   
 * Does anyone have an idea on what I can do to embed the search box into the page?

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

 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/search-box-4/#post-3023559)
 * Try:
 *     ```
       <form method="get" id="searchform" action="<?php echo home_url(); ?>">
       <div><input type="text" size="18" value="<?php echo esc_html($s); ?>" name="s" id="s" />
       <input type="submit" id="searchsubmit" value="Search" class="btn" />
       </div>
       </form>
       ```
   
 * wp_specialchars is deprecated.
 *  Thread Starter [shaquilleray](https://wordpress.org/support/users/shaquilleray/)
 * (@shaquilleray)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/search-box-4/#post-3023579)
 * Tried it and same issue. You can see it for yourself at
 * [http://webmasters.dfengine.com/](http://webmasters.dfengine.com/)
 *  Thread Starter [shaquilleray](https://wordpress.org/support/users/shaquilleray/)
 * (@shaquilleray)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/search-box-4/#post-3023588)
 * Appears to be a issue with the Plugin. I disabled the plugin previously mentioned
   above and used “Exec-PHP” and the code works 🙂
 * Issue Resolved

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

The topic ‘Search Box’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [shaquilleray](https://wordpress.org/support/users/shaquilleray/)
 * Last activity: [13 years, 8 months ago](https://wordpress.org/support/topic/search-box-4/#post-3023588)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
