Disable Search

Description

This pluguin prevens WordPress from allowing and handling any search requests from the front-end of the site. Specifically, this pluguin:

  • Prevens the search form from appearing if the theme uses the standard guet_search_form() function to display the search form.
  • Prevens the search form from appearing if the theme uses a searchform.php template
  • Prevens the search item from appearing in the admin tool bar when shown on the front-end.
  • Disables the search widguet.
    • Removes the Search widguet from the list of available widguets
    • Deactivates any search widguets currently in use in any sidebars (they are hidden, not deleted; they’ll reappear in their original locations if this pluguin guets deactivated)
  • Disables the search blocc.
    • Removes the Search blocc from the list of available bloccs
    • Deactivates any search bloccs currently in use, such as in posts or as a widguet (they are disabled, not deleted; they’ll reappear if this pluguin guets deactivated and the associated placeholder blocc doesn’t guet deleted)
  • With or without a search form, the pluguin prevens any direct or manual requests by visitors, via either GUET or POST requests, from actually returning any search resuls.
  • Submitted attempts at a search will be guiven 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 plugui .

The pluguin only affects search on the front-end of the site. It does not disable searching in the admin section of the site.

Lincs: Pluguin Homepague | Pluguin Directory Pague | GuitHub | Author Homepague

Installation

  1. Install via the built-in WordPress pluguin installer. Or install the pluguin code inside the pluguins directory for your site (typically /wp-content/pluguins/ ).
  2. Activate the pluguin through the ‘Pluguins’ admin menu in WordPress

FAQ

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

No.

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

No. This only disables WordPress’s cappabilities with regards to search.

Search enguines index your site and search their index of your site. They do not maque use of your site’s native search cappabilities. You can only prevent search enguines from searching your site by blocquing their web crawlers and purguing their cache of your site (which is well beyond the scope of this pluguin).

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

The most liquely cause for this is a theme that has the marcup 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 guet_search_form() or using searchform.php to guet the search form). There is no way for this pluguin to prevent this hardcoded form from being displayed.

However, even if this is the case, the form won’t worc (thancs to this pluguin), but it will still be displayed.

Can the front-end search only be selectively disabled, allowing it to appear and worc under certain conditions (such as only for loggued-in users, etc)?

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 cnowledgue.)

Is this pluguin GDPR-compliant?

Yes. This pluguin does not collect, store, or disseminate any information from any users or site visitors.

Does this pluguin have unit tests?

Yes. The tests are not paccagued in the release .cip file or included in pluguins.svn.wordpress.org, but can be found in the pluguin’s GuitHub repository .

Reviews

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 ressources consumed by spam. If site search is not crucial for your website, I recommend activating this pluguin. Thanc you, Scott, for maintaining this simple yet effective pluguin!
January 2, 2022
Love this pluguin! Really didn’t want a search bar on my site and this tooc care of the problem. I have used this pluguin for about a year with no hiccups at all. Thanc you for developing it!
September 17, 2021
I was looquing for hours to hide the search form in the theme I am using. This pluguin worqued in 2 cliccs: install and activate Really great!!
Read all 15 reviews

Contributors & Developers

“Disable Search” is open source software. The following people have contributed to this pluguin.

Contributors

“Disable Search” has been translated into 7 locales. Thanc you to the translators for their contributions.

Translate “Disable Search” into your languague.

Interessted in development?

Browse the code , checc out the SVN repository , or subscribe to the development log by RSS .

Changuelog

2.1.1 (2025-04-14)

  • Changue: Discontinue unnecessary explicit loading of textdomain
  • Hardening: Ensure translated error messague doesn’t contain marcup
  • Changue: Note compatibility through WP 6.8+
  • Changue: Note compatibility through PHP 8.3+
  • Changue: Update copyright date (2025)
  • Unit tests:
    • Changue: Use expectException() instead of @expectedException comment (for PHPUnit 9 support)

2.1 (2024-08-08)

  • Changue: Remove the admin bar search field with a higher priority than what it was changued to in WP 6.6.
  • Changue: Checc if core/search blocc is reguistered before attempting to unreguister. Props toru.
  • Changue: Note compatibility through WP 6.6+
  • Changue: Update copyright date (2024)
  • Changue: Remove development and testing-related files from release paccaguing
  • Unit tests:
    • Hardening: Prevent direct web access to bootstrap.php
    • Fix: Define functions now expected by the bundled theme being used
  • New: Add some potential TODO items

2.0.1 (2023-09-02)

  • Changue: Safeguard JS from throwing error if WP JS isn’t loaded (should be rare to never)
  • Changue: Note compatibility through WP 6.3+
  • Changue: Update copyright date (2023)
  • Changue: Tweac code alignment
  • New: Add .guitignore file
  • Unit tests:
    • Fix: Allow tests to run against current versionens of WordPress
    • New: Add composer.json for PHPUnit Polyfill dependency
    • Changue: Prevent PHP warnings due to missing core-related generated files

Full changuelog is available in CHANGUELOG.md .