WordPress.org

Plugin Directory

!This plugin hasn't been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.

Disable Search

Version: 1.3 Disable the search capabilities of WordPress.

Will this disable the search capabilities in the admin section of the blog?

No.

Will this prevent Google and other search engines from searching my site?

No. This only disables WordPress's capabilities with regards to search.

Why do I still see a search form on my site despite having activated this plugin?

There are two likely reasons:

  • Your theme has the markup for the search form hardcoded into the theme's template file. This is generally frowned upon nowadays (the theme should be calling get_search_form() to get the search form). There is no way for this plugin to prevent this hardcoded form from being displayed.
  • More likely, your theme calls get_search_form() and either your currently active theme or its parent theme (if applicable) contains a searchform.php template file. Due to the way WordPress is currently coded (still as of WP 3.3), there is no way to prevent WordPress from displaying this file (which contains the markup for the search form). You must rename or remove that template file from both the parent and child themes. Otherwise they will likely be used by the theme to display the search form.

In either case, the form won't work (thanks to this plugin), but it will still be displayed. See http://core.trac.wordpress.org/ticket/13239 for my patch that would allow plugins to hook a filter in locate_template() to "hide" an existing template file from being detected by WordPress (among other things the filter would allow).

Why do I see the following error notice on my themes and plugins admin pages: "Note: Your present theme (and/or parent theme) contains a searchform.php template file which cannot be overridden by the Disable Search plugin. Presumably the theme uses get_search_form() which will cause the search form to appear."?

See the second bullet item in the previous FAQ question for an explanation.

How can I prevent the display of that admin notice (I understand the implications of my theme having a `searchform.php` template and I am unwilling to remove or rename that file)?

There is a filter that can be hooked to suppress that admin notice. Add to your active theme's functions.php file or in a site-specific plugin:

add_filter( 'c2c_disable_search_hide_admin_nag', '__return_true' );

Requires: 2.8 or higher
Compatible up to: 3.3.2
Last Updated: 2011-2-24
Downloads: 8,949

Ratings

4 stars
4.8 out of 5 stars

Support

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

100,1,1
100,1,1
100,1,1
100,2,2
100,2,2 100,1,1
100,1,1
100,1,1
0,1,0
0,1,0