Prevent search query from taking place when using Google CSE?

Same issue with you and just found it out on stackexchange. Put codes below in the function.php in your theme. function _cancel_query( $query ) { if ( !is_admin() && !is_feed() && is_search() ) { $query = false; } return $query; } add_action( ‘posts_request’, ‘_cancel_query’ ); Here’s the source

WP + Google analytics = /search?

Search code comes with wordpress.If you remove search box it does not mean that search page is removed. If you want that google should not crawl your search page then you can specify in your robot.txt file like below : Disallow: /search

use a custom page to display search results

I noticed that your goal is to have an editable content on the search result. You can use another method to do that, by calling the content of the page from your search.php file. You can start by creating a page with the slug search-page as usual. You can also add post meta / custom … Read more

Filter out a meta key in the Search results page with two CPT

You could add a second array to check if the ‘DTEND’ value is not set: $args = array_merge( $wp_query->query_vars, array( ‘meta_query’=> array( ‘relation’ => ‘OR’, array( ‘key’ => ‘DTEND’, ‘compare’ => ‘>=’, ‘value’ => $currentdate, ), array( ‘key’ => ‘DTEND’, ‘compare’ => ‘NOT EXISTS’, ) ), ) ); That way, any custom posts without a … Read more

Remove Page Timestamp via functions.php so it doesn’t show in Google Search Result Description [closed]

It depends on what the template uses to output whatever you’re trying to remove. If you look in source at whatever function is outputting what you want to remove, they each have a filter to let you modify output where you can __return_false instead, however, if there’s text or markup surrounding those template tags, your … Read more

How to use another file instead of home.php

You could filter home_template, check for the presence whatever $_GET var is reliably set for each of those requests, and load a different template for those cases. function wpd_home_template( $home_template=”” ){ if( isset( $_GET[‘search_type’] ) ){ $home_template = locate_template( ‘homesearch.php’, false ); } return $home_template; } add_filter( ‘home_template’, ‘wpd_home_template’ ); EDIT- fixed incorrect var test.