Changing the Search box event behavior

Posted in: Newspaper
Post count: 45

Hi, i am using the google search results, when a user click on Search button, a new page of results is opened.
I am using in this way because i don’t want to load the database server with long queries.
But recently i realized that while the user is typing in the search box, (starting from the thirth or fourth character) the query is shooted in background with ajax. I want to disable this behavior, where i could do it?
Thanks.

Post count: 20685

Hi,

So you are using a different search functionality then the default search. You could try and find solutions online, or maybe use a plugin that has more options to customize the search process
http://www.wpbeginner.com/wp-tutorials/how-to-add-google-search-in-a-wordpress-site/
https://www.greengeeks.com/tutorials/article/how-to-incorporate-google-custom-search-in-wordpress/

Thanks

Post count: 45

My google search is working perfectly!. I don’t need another tutorial to do that. I need to know how to disable the default behavior of seek when anybody press a key in the search field of the Newspaper Theme. Because it is only a background task that is shooted while you are writing in the search input field. I could see that in my linux logs files of the mysql.
Only when the user press the search button or Enter Key begin the search with google search, but before that you have 3 or more SQL queries to the database when the user is typing what to search.
We have 30.000 visit per day and this queries are generating a lot of unnecessary load in my server.
If you want, you can see the ajax queries shooted, in the code inspector of chrome.

Rregards.

Post count: 20685

Hi,

If you would like to remove the default search, you could do that by removing it in the theme files entirely
https://www.screencast.com/t/aLph2hww3gj
At the moment the theme does not have an option to remove the search, it may be available in the future.

Thanks

Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic.