Wordpress Search Widget Change Placeholder

WordPress get_search_query empty

Rate this article

Share this article

Read WordPress search analytics using GA for more information.

WordPress get_search_query empty

It retrieves the contents of the search WordPress query variable. So apparently, when WordPress sees an empty search string it doesn’t even use it and sends the search to the home page.

You offer a search input field, and someone hits the submit button unintentionally, without any term entered. The resulting URI looks like this: example.com/?s=. It shows the same content as your front page. In fact, it is the front page.

No one needs that.

wordpress search queries google analytics

Add great search to your WordPress site @9 usd per month

Empty results are handled using get_search_query() function but this can get quite tricky if not handled properly. If you are not that tech-savvy, it is easier to go for a fully configurable search bar like ExpertRec. This will let you set up no results pages easily.

Are you showing the right products, to the right shoppers, at the right time? Contact us to know more.
You may also like