Discover, trust, install: FAIR 1.0 is here
Disable Search
Version: 2.1.1
Description
This plugin prevents WordPress from allowing and handling any search requests from the front-end of the site. Specifically, this plugin:
- Prevents the search form from appearing if the theme uses the standard
get_search_form()
function to display the search form. - Prevents the search form from appearing if the theme uses a
searchform.php
template - Prevents the search item from appearing in the admin tool bar when shown on the front-end.
- Disables the search widget.
- Removes the Search widget from the list of available widgets
- Deactivates any search widgets currently in use in any sidebars (they are hidden, not deleted; they’ll reappear in their original locations if this plugin gets deactivated)
- Disables the search block.
- Removes the Search block from the list of available blocks
- Deactivates any search blocks currently in use, such as in posts or as a widget (they are disabled, not deleted; they’ll reappear if this plugin gets deactivated and the associated placeholder block doesn’t get deleted)
- With or without a search form, the plugin prevents any direct or manual requests by visitors, via either GET or POST requests, from actually returning any search results.
- Submitted attempts at a search will be given a 404 File Not Found response, rendered by your site’s 404.php template, if present.
- Disables output of
SearchAction
in SEO schema by the Yoast SEO plugin.
The plugin only affects search on the front-end of the site. It does not disable searching in the admin section of the site.
Links: Plugin Homepage | Plugin Directory Page | GitHub | Author Homepage
Installation
- Install via the built-in WordPress plugin installer. Or install the plugin code inside the plugins directory for your site (typically
/wp-content/plugins/
). - Activate the plugin through the ‘Plugins’ admin menu in WordPress
Faq
No.
No. This only disables WordPress’s capabilities with regards to search.
Search engines index your site and search their index of your site. They do not make use of your site’s native search capabilities. You can only prevent search engines from searching your site by blocking their web crawlers and purging their cache of your site (which is well beyond the scope of this plugin).
The most likely cause for this is a theme that has the markup for the search form hardcoded into one or more of the theme’s template files (excluding searchform.php
). This is generally frowned upon nowadays (the theme should be calling get_search_form()
or using searchform.php
to get the search form). There is no way for this plugin to prevent this hardcoded form from being displayed.
However, even if this is the case, the form won’t work (thanks to this plugin), but it will still be displayed.
No, not at this time, though it is feature being considered. (In truth, custom coding could certainly be used to achieve this, but that obviously requires coding knowledge.)
Yes. This plugin does not collect, store, or disseminate any information from any users or site visitors.
Yes. The tests are not packaged in the release .zip file or included in plugins.svn.wordpress.org, but can be found in the plugin’s GitHub repository.
Reviews
Magnificent little plugin
By awesiome on October 28, 2024
Does exactly what it says. Just activate and it completely disables all default WordPress search functionality from the frontend.
The most effective way to avoid search spam
By Takahashi Fumiki (Takahashi_Fumiki) on May 1, 2024
In 2024, numerous bots are crawling sites, generating significant search spam. Generally, site search incurs high costs, primarily because we end up paying for CPU resources consumed by spam.
If site search is not crucial for your website, I recommend activating this plugin.
Thank you, Scott, for maintaining this simple yet effective plugin!
Handful
By Dennis (1404iran) on February 9, 2022
Easy to Use! Works Flawlessly!
By aliakey7 on January 2, 2022
Great one
By gerlofdelange on September 17, 2021
Best in addition to Google Custom Search
By shirtguy72 on April 13, 2020
perfect plugin
By Harry (dibbyo456) on July 28, 2019
good!!
By intenni on October 8, 2018
Awesome, FINALLY able to disable search!!!
By cpowersgeoshack on May 19, 2017
Breaks Jetpack gallery and Google Maps API
By odw2017 on April 25, 2017
Changelog
2.1.1 (2025-04-14)
- Change: Discontinue unnecessary explicit loading of textdomain
- Hardening: Ensure translated error message doesn’t contain markup
- Change: Note compatibility through WP 6.8+
- Change: Note compatibility through PHP 8.3+
- Change: Update copyright date (2025)
- Unit tests:
- Change: Use
expectException()
instead of@expectedException
comment (for PHPUnit 9 support)
- Change: Use
2.1 (2024-08-08)
- Change: Remove the admin bar search field with a higher priority than what it was changed to in WP 6.6.
- Change: Check if core/search block is registered before attempting to unregister. Props toru.
- Change: Note compatibility through WP 6.6+
- Change: Update copyright date (2024)
- Change: Remove development and testing-related files from release packaging
- Unit tests:
- Hardening: Prevent direct web access to
bootstrap.php
- Fix: Define functions now expected by the bundled theme being used
- Hardening: Prevent direct web access to
- New: Add some potential TODO items
2.0.1 (2023-09-02)
- Change: Safeguard JS from throwing error if WP JS isn’t loaded (should be rare to never)
- Change: Note compatibility through WP 6.3+
- Change: Update copyright date (2023)
- Change: Tweak code alignment
- New: Add
.gitignore
file - Unit tests:
- Fix: Allow tests to run against current versions of WordPress
- New: Add
composer.json
for PHPUnit Polyfill dependency - Change: Prevent PHP warnings due to missing core-related generated files
Full changelog is available in CHANGELOG.md.