Title: Disable search functionality
Last modified: August 19, 2016

---

# Disable search functionality

 *  [98503-1](https://wordpress.org/support/users/98503-1/)
 * (@98503-1)
 * [17 years, 4 months ago](https://wordpress.org/support/topic/disable-search-functionality/)
 * What would be the best way to go about disabling search from the blog?
 * It’s not that I simply want to remove the search form and file, which I can do.
   Is there any database information specifically for search function (there used
   to be, I’m fairly sure, but it may not be the case any longer as I haven’t seen
   any at a glance)? If so, how would the code be altered so that no information
   would be sent to/from the database regarding search function?
 * Thank you.

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

 *  [Mark](https://wordpress.org/support/users/wpsec/)
 * (@wpsec)
 * [17 years, 4 months ago](https://wordpress.org/support/topic/disable-search-functionality/#post-966832)
 * Create a pluging that empties the ‘s’ variable for URLs and forms – 3 possible
   places. Something like this:
 *     ```
       <?php
       Plugin Name: Disable Search
       Plugin URI: http://wpsecurity.net
       Description: This disables the search feature of WordPress.
       Author: Mark
       Version: 1.0
       Author URI: http://wpsecurity.net
       */
       $_GET['s']='';
       $_POST['s']='';
       $_REQUEST['s']='';
       ?>
       ```
   
 * Copy that to a file in your plugins dir (maybe a filename like disablesearch.
   php), activate the plugin, and then try to do a search manually for a word you
   know exists in your site, then see if the search returns nothing. Example search
   URL:
 * [http://somerealsitename.com/?s=test](http://somerealsitename.com/?s=test)
 *  [Michael Clark](https://wordpress.org/support/users/planetmike/)
 * (@planetmike)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/disable-search-functionality/#post-967065)
 * You’re missing the “start comment command” in front of the second line:
 *     ```
       /* Plugin Name: Disable Search
       ```
   
 * Looking through my web logs I found several search engines using the WordPress
   search engine to search my site. I wonder if somewhere on the web is a link to
   my site with the search pre-defined.

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

The topic ‘Disable search functionality’ is closed to new replies.

## Tags

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

 * 2 replies
 * 3 participants
 * Last reply from: [Michael Clark](https://wordpress.org/support/users/planetmike/)
 * Last activity: [16 years, 5 months ago](https://wordpress.org/support/topic/disable-search-functionality/#post-967065)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
