=== Disable Search === Contributors: littlebizzy Donate link: https://www.patreon.com/littlebizzy Tags: disable, search, form, queries, strings Requires at least: 4.4 Tested up to: 5.0 Requires PHP: 7.0 Multisite support: No Stable tag: 1.1.0 License: GPLv3 License URI: http://www.gnu.org/licenses/gpl-3.0.html Prefix: DSBSRC Completely disables the built-in WordPress search function to prevent snoopers or bots from querying your database or slowing down your website. == Description == Completely disables the built-in WordPress search function to prevent snoopers or bots from querying your database or slowing down your website. * [**Join our FREE Facebook group for support**](https://www.facebook.com/groups/littlebizzy/) * [**Worth a 5-star review? Thank you!**](https://wordpress.org/support/plugin/disable-search-littlebizzy/reviews/?rate=5#new-post) * [Plugin Homepage](https://www.littlebizzy.com/plugins/disable-search) * [Plugin GitHub](https://github.com/littlebizzy/disable-search) #### Current Features #### Disable Search is a simple plugin that disables the search function on a WordPress website for the purpose of preventing snoopers or robots from spying on your content. Specifically, it disables the built-in `/?s=foo` query function that comes with WordPress. What many webmasters and developers don't realize is that even if you don't have a search feature designed into your WordPress site, tech-savvy users or bots can still query this URL directly on your given domain. This not only can hurt privacy (view content not meant to be seen in such a way), but also SEO (weird URLs indexed into search engines). Lastly, it can also hurt your website/server performance because such queries are in fact "uncached" dynamic queries, meaning that they send requests directly to your database i.e. MySQL. Theoretically such requests could be used to attack or crash your website, or for other malicious reasons such as negative SEO campaigns, etc. Unlike other "disable search" plugins, this plugin does not alter the design or appearance of your site. In other words, if you have a search widget, form, or so forth designed into your Widgets settings, WordPress theme, or otherwise, this plugin will not remove or alter those. Instead, it blocks the query URLs directly, turning them into 404 errors (Not Found). We decided for initial release not to have a "settings" page or allow any redirects of these search query URLs. Instead, you can pair this plugin perfectly with our other plugin called 404 To Homepage if you wish to redirect these "404 searches" automatically to your homepage. * Test in WP 4.7 with Disable Search only activated: GET /?s=test HTTP/1.1 Response headers: HTTP/1.1 404 Not Found Server: nginx/1.4.6 (Ubuntu) Date: Wed, 14 Dec 2016 20:10:30 GMT Transfer-Encoding: chunked Connection: keep-alive Expires: Wed, 11 Jan 1984 05:00:00 GMT Cache-Control: no-cache, must-revalidate, max-age=0 Link: ; rel="https://api.w.org/" * Test in WP 4.7 with both Disable Search and 404 To Homepage activated: GET /?s=test HTTP/1.1 Response headers: HTTP/1.1 301 Moved Permanently Server: nginx/1.4.6 (Ubuntu) Date: Wed, 14 Dec 2016 20:49:33 GMT Transfer-Encoding: chunked Connection: keep-alive Location: http://example.com #### Compatibility #### This plugin has been designed for use on [SlickStack](https://slickstack.io) web servers with PHP 7.2 and MySQL 5.7 to achieve best performance. All of our plugins are meant for single site WordPress installations only; for both performance and usability reasons, we highly recommend avoiding WordPress Multisite for the vast majority of projects. Any of our WordPress plugins may also be loaded as "Must-Use" plugins by using our free [Autoloader](https://github.com/littlebizzy/autoloader) script in the `mu-plugins` directory. #### Defined Constants #### /* Plugin Meta */ define('DISABLE_NAG_NOTICES', true); #### Technical Details #### * Prefix: DSBSRC * Parent Plugin: [**SEO Genius**](https://www.littlebizzy.com/plugins/seo-genius) * Disable Nag Notices: [Yes](https://codex.wordpress.org/Plugin_API/Action_Reference/admin_notices#Disable_Nag_Notices) * Settings Page: No * PHP Namespaces: No * Object-Oriented Code: No * Includes Media (images, icons, etc): No * Includes CSS: No * Database Storage: Yes * Transients: No * WP Options Table: Yes * Other Tables: No * Creates New Tables: No * Creates New WP Cron Jobs: No * Database Queries: Backend Only (Options API) * Must-Use Support: [Yes](https://github.com/littlebizzy/autoloader) * Multisite Support: No * Uninstalls Data: Yes #### Special Thanks #### [Alex Georgiou](https://www.alexgeorgiou.gr), [Automattic](https://automattic.com), [Brad Touesnard](https://bradt.ca), [Daniel Auener](http://www.danielauener.com), [Delicious Brains](https://deliciousbrains.com), [Greg Rickaby](https://gregrickaby.com), [Matt Mullenweg](https://ma.tt), [Mika Epstein](https://halfelf.org), [Mike Garrett](https://mikengarrett.com), [Samuel Wood](http://ottopress.com), [Scott Reilly](http://coffee2code.com), [Jan Dembowski](https://profiles.wordpress.org/jdembowski), [Jeff Starr](https://perishablepress.com), [Jeff Chandler](https://jeffc.me), [Jeff Matson](https://jeffmatson.net), [Jeremy Wagner](https://jeremywagner.me), [John James Jacoby](https://jjj.blog), [Leland Fiegel](https://leland.me), [Luke Cavanagh](https://github.com/lukecav), [Mike Jolley](https://mikejolley.com), [Pau Iglesias](https://pauiglesias.com), [Paul Irish](https://www.paulirish.com), [Rahul Bansal](https://profiles.wordpress.org/rahul286), [Roots](https://roots.io), [rtCamp](https://rtcamp.com), [Ryan Hellyer](https://geek.hellyer.kiwi), [WP Chat](https://wpchat.com), [WP Tavern](https://wptavern.com) #### Disclaimer #### We released this plugin in response to our managed hosting clients asking for better access to their server, and our primary goal will remain supporting that purpose. Although we are 100% open to fielding requests from the WordPress community, we kindly ask that you keep these conditions in mind, and refrain from slandering, threatening, or harassing our team members in order to get a feature added, or to otherwise get "free" support. The only place you should be contacting us is in our free [**Facebook group**](https://www.facebook.com/groups/littlebizzy/) which has been setup for this purpose, or via GitHub if you are an experienced developer. Thank you! #### Our Philosophy #### > "Decisions, not options." -- WordPress.org > "Everything should be made as simple as possible, but not simpler." -- Albert Einstein, et al > "Write programs that do one thing and do it well... write programs to work together." -- Doug McIlroy > "The innovation that this industry talks about so much is bullshit. Anybody can innovate... 99% of it is 'Get the work done.' The real work is in the details." -- Linus Torvalds #### Search Keywords #### 404, 404 error, 404 errors, 404 error search, 404 error search results, 404 search, 404 search error, disable, disable search, hide, hide search, remove, remove search, search results, search results 404, search results 404 error == Installation == 1. Upload to `/wp-content/plugins/disable-search-littlebizzy` 2. Activate via WP Admin > Plugins 3. Test plugin is working: After plugin activation, purge all caches. Then, verify WordPress search queries will "404" by appending `/?s=foo` or `/search/foo/` to site URL like a normal search form tool would do. The result page should be a 404 error. If used alongside our free 404 To Homepage plugin these types of queries should 301 redirect to the homepage as well. == FAQ == = Does this plugin alter anything related to Appearance? = No, and it's not meant to. Search widgets, themes, menus, CSS, or otherwise are not altered whatsoever. = How can I change this plugin's settings? = This plugin does not have a settings page and is designed for speed and simplicity. There are no settings that can be changed. = I have a suggestion, how can I let you know? = Please avoid leaving negative reviews in order to get a feature implemented. Instead, join our free Facebook group. == Changelog == = 1.1.0 = * tested with WP 5.0 * updated plugin meta = 1.0.10 = * updated plugin meta = 1.0.9 = * added warning for Multisite installations * updated recommended plugins = 1.0.8 = * tested with WP 4.9 * added support for `DISABLE_NAG_NOTICES` = 1.0.7 = * optimized plugin code * reset admin notices timestamps = 1.0.6 = * optimized plugin code * updated recommended plugins = 1.0.5 = * fixed admin notices timestamp calculation (again) = 1.0.4 = * fixed admin notices timestamp calculation = 1.0.3 = * optimized plugin code * added rating request notice = 1.0.2 = * added recommended plugins notice = 1.0.1 = * tested with WP 4.8 * updated plugin meta = 1.0.0 = * initial release