How to remove the message 'We could not find any results for your search' without changing template files and without adding posts/pages?

I take the question back with context.

The goal is not to add posts or pages so that the post is replaced by the title of the post/page.

The goal is not to modify the search.php file to remove this error message by hand.

Imagine the situation. We have a normal page with a search widget in a sidebar or in the footer. If you launch the search, you will have your site loading due to the widget submit. Wordpress will search for search.php but since I have 0 articles on my site it will display the title of this topic. I want to delete this message no matter what theme a user selects. If I manage to remove this message, I will be able to use my second widget which will take care of the particular display, but I need to remove the message first.

I can't use AJAX because I will lose the URL change when searching. I can't use style classes because each theme has its own style.

Is there any way to remove this message despite these conditions?

Topic php plugin-development hooks Wordpress search

Category Web


The answer was to change the input name variable of the form. It was 's' for my widget.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.