How to Disable the Search Feature in WordPress

HostPapa Knowledge Base
Margaret Vargas

This plugin prevents the search form appearing in most WordPress themes and disables the search sidebar widget. Note that the plugin only disables search from the front-end of your site. Back-end search features in the WordPress admin dashboard are unaffected.
Bryanna Atwell

thanks for the link! It seems that when adding the Shortcode, so extra HTML code was added well. Please go to the “Edit” screen of this page, and switch from the “Visual” to the “Text” editor. Then, please remove all <pre> and </pre> HTML tags around the Shortcode.

How to disable Search feature in WordPress?
Phyllis Cohen

This code will redirect all direct or indirect search queries to a 404 page. This code will hide the search form in your WordPress theme. If you set $error to be “true” in the above code, then the user will be redirected to your 404 page. You must have theme’s 404.php. If you set it as “false”, the user stays at the page where they tried to run the search.

Be the first to comment

Leave a Reply

Your email address will not be published.