Disable Search

Omschrijving

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
  • Voorkom dat het zoekitem in de admin toolbar verschijnt wanneer deze op de front-end wordt weergegeven.
  • 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)
  • 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

Installatie

  1. Install via the built-in WordPress plugin installer. Or download and unzip disable-search.zip inside the plugins directory for your site (typically wp-content/plugins/)
  2. Activate the plugin through the ‘Plugins’ admin menu in WordPress

FAQ

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

Nee.

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

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

Why do I still see a search form on my site despite having activated 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.

Can the front-end search only be selectively disabled, allowing it to appear and work under certain conditions (such as only for logged-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 knowledge.)

Is this plugin GDPR-compliant?

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

Does this plugin include unit tests?

Yes.

Beoordelingen

15 januari 2017
Very useful for certain type of websites! Is it ok for WP 4.7 and after?
Lees alle 10 beoordelingen

Bijdragers & ontwikkelaars

“Disable Search” is open source software. De volgende personen hebben bijgedragen aan deze plugin.

Bijdragers

“Disable Search” is vertaald in 3 talen. Dank voor de vertalers voor hun bijdragen.

Vertaal “Disable Search” naar jouw taal.

Interesse in ontwikkeling?

Bekijk de code, haal de SVN repository op, of abonneer je op het ontwikkellog via RSS.

Changelog

1.8.3 (2021-05-01)

  • Fix: Change __wakeup() method visibility from private to public to avoid warnings under PHP8
  • Fix: Throw an error when attempting to unserialize an instance of the class to actually prevent it from happening

1.8.2 (2021-04-08)

  • Change: Note compatibility through WP 5.7+
  • Change: Update copyright date (2021)
  • Change: Tweak wording and formatting of readme.txt
  • New: Add FAQ entry
  • New: Add unit tests to verify search is removed from admin bar

1.8.1 (2020-09-07)

  • Change: Restructure unit test file structure
    • New: Create new subdirectory phpunit/ to house all files related to unit testing
    • Change: Move bin/ to phpunit/bin/
    • Change: Move tests/bootstrap.php to phpunit/
    • Change: Move tests/ to phpunit/tests/
    • Change: Rename phpunit.xml to phpunit.xml.dist per best practices
  • Change: Note compatibility through WP 5.5+

Full changelog is available in CHANGELOG.md.