Shop WP.blogspot.com

Easy methods to Disable the Search Function in WordPress

Do you need to disable the search function in WordPress? Typically your web site could not want the search function and the search kind in your theme could intrude with consumer expertise. On this article, we are going to present you how one can simply disable the search function in WordPress.

Disabling search feature in WordPress

Why and Who Ought to Disable Search Function in WordPress?

Many WordPress web sites are easy business websites with a number of pages. There's additionally a rising pattern of one-page websites with vertical navigation.

These web sites doesn't have a lot content material which makes search form a novelty merchandise and never a helpful function.

It additionally offers customers the impression that there is perhaps another data that they will’t see and therefore the search choice. Eradicating search function will clear up your web site and supply a greater consumer expertise.

That being mentioned, let’s check out how one can simply take away search function out of your WordPress web site.

Technique 1. Take away Search Function in WordPress Utilizing a Plugin

This technique is less complicated and is really helpful for all customers.

Very first thing it is advisable to do is set up and activate the Disable Search plugin. For extra particulars, see our step-by-step information on how to install a WordPress plugin.

The plugin works out of the field, and there are not any settings so that you can configure.

Upon activation, it's going to take away search kind out of your WordPress theme and disable the search widget. If a consumer straight tried to enter a search question URL, the plugin will return a 404 error page.

Observe that this plugin doesn't have an effect on the search performance contained in the WordPress admin area. You possibly can nonetheless search posts and pages inside your WordPress admin.

Technique 2. Manually Disable Search Function in WordPress

This technique requires you so as to add code to your WordPress recordsdata. Should you haven’t finished this earlier than, then check out our information on how to copy and paste code in WordPress.

You have to so as to add this code to your theme’s functions.php file or a site-specific plugin.

perform wpb_filter_query( $question, $error = true ) 
add_action( 'parse_query', 'wpb_filter_query' );
add_filter( 'get_search_form', create_function( '$a', "return null;" ) );
perform remove_search_widget() {
	unregister_widget('WP_Widget_Search');

add_action( 'widgets_init', 'remove_search_widget' );

This code will merely redirect all direct or oblique search queries to a 404 web page. It is going to additionally conceal the search kind in your WordPress theme.

Search form widget removed

We hope this text helped you learn to simply disable search function in WordPress. You may additionally need to see our mega record of the most wanted WordPress tips, tricks, and hacks.

Should you preferred this text, then please subscribe to our YouTube Channel for WordPress video tutorials. You can too discover us on Twitter and Facebook.

Tutorials