Just another contact form plugin. Simple but flexible.
About Disable Search
This plugin disables the search functionality on the front-end of your WordPress site. It prevents the search form from appearing, disables the search widget and search block, and returns a 404 error for any search requests. It does not affect searching in the admin section of your site.Frequently asked questions
What does this plugin do?
This plugin prevents WordPress from allowing and handling any search requests from the front-end of the site.
What does the plugin do to the search form?
The plugin prevents the search form from appearing if the theme uses the standard get_search_form() function to display the search form, or if the theme uses a searchform.php template.
What does the plugin do to the search widget?
The plugin disables the search widget by removing it from the list of available widgets and deactivating any search widgets currently in use in any sidebars.
What does the plugin do to the search block?
The plugin disables the search block by removing it from the list of available blocks and deactivating any search blocks currently in use, such as in posts or as a widget.
What response does the plugin give for search attempts?
The plugin gives a 404 File Not Found response, rendered by your site's 404.php template, if present.
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@expectedExceptioncomment (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
.gitignorefile - Unit tests:
- Fix: Allow tests to run against current versions of WordPress
- New: Add
composer.jsonfor PHPUnit Polyfill dependency - Change: Prevent PHP warnings due to missing core-related generated files
Full changelog is available in CHANGELOG.md.