How to make WordPress search prioritise page titles?

You can replace the default WordPress search with something more useful. As you have pointed out, the build-in search is very limited. So you’re not the first one with this problem. I suggest the following two plugins: Search API (WordPress Plugin) WordPress Sphinx Search Plugin (WordPress Plugin) The last one allows to weight between parts … Read more

Unified search across separate WordPress installations

You should move your sites to the same server and same DB and then you will be able to run whatever queries you. Barring that, the only alternative I know to writing your own search engine is to use google’s site search API which gives you access to the raw data instead of the snippets … Read more

Insert DIV container below 1st search result

You should be able to do that with: /** * Setup a custom hook before the second post on the search page */ add_action( ‘the_post’, function( $post, \WP_Query $q ) { if( $q->is_search() && $q->is_main_query() && 2 === $q->current_post ) { do_action( ‘wpse_before_second_post_in_search’ ); } }, 10, 2 ); /** * Inject a Div after … Read more

Template issues getting ajax search results

When you load a template file directly that way, you’re not loading the WordPress environment, so no WordPress functions are available. Your two options are to either load the search page on the front end and filter the result, like: $(‘#results’).load(‘http://mysite.com/?s=searchterm ul#target’); Or build a search function using WordPress provided AJAX functionality, see AJAX in … Read more

Remove meta robots tag from wp_head

add_filter(‘wpseo_robots’, ‘yoast_no_home_noindex’, 999); function yoast_no_home_noindex($string= “”) { if (is_home() || is_front_page()) { $string= “index,follow”; } return $string; } this should be fine i think.. somewhere in your theme functions.php and should do the trick.

How can i move search results onto a specific page?

You created a page with the slug search to “capture” that URL, but WordPress by default already uses that URL for search results. So you were “lucky” that this worked for you, and this is the reason the redirect supermethod mentioned will work. So, instead of creating a “fake” page to hold the template, you … Read more

Empty search input returns all posts

Just an alternative to the informative answer by @PieterGoosen. After Pieter posted this part: if ( ! empty( $q[‘s’] ) ) { $search = $this->parse_search( $q ); } it came to mind that it might be possible to re-parse the search query, within the posts_search filter, for empty search string. But the parse_search() method is … Read more

Display search results within the same page

The simplest option if you want to show search results within a page context you’ll need to do a custom loop, otherwise you won’t be able to access the page information. Change the input with the name s to something else like search or q to stop wordpress from doing it’s usual built in search. … Read more