• I’m trying to figure out how to disable the search results page which is produced by entering https://www.yourwebsite.com/?s=terms

    I am using this custom theme which has its own search interface that is built into the theme. They use the built-in WordPress search but add on to it.

    The themes search results page is different from what displays on the yoursite.com/?s=terms page, however both of these pages are using the theme’s search.php file.

    The issue is, the theme developer has not considered the situation where an end-user would manually enter something like ?s=terms into their browser. And my issue is that there are missing featured image thumbnails on the WordPress ?s=terms result page.

    I can’t fully disable the WordPress search functionality on the front end (as described in this article: https://www.wpbeginner.com/wp-tutorials/how-to-disable-the-search-feature-in-wordpress/), because it will also break my themes search functionality and direct everything to a 404 page.

    Is there a way to simply disable the ?s= page from displaying results?

Viewing 2 replies - 1 through 2 (of 2 total)
  • No, the s variable is what makes WP use the search.php template.
    Since you have a theme that is modifying this, it likely isn’t in the WP repository, so it isn’t supported here. You need to ask the theme author about the differences with different invocations.

    Thread Starter americanninja

    (@americanninja)

    Thanks for the explanation @joyously. This actually gave me a good idea. Unfortunately, the theme developer is fairly unhelpful, but I’m stuck with the theme for now.

    I figured out an easy solution to my problem. Since the theme has it’s own search results interface, I simply copied over the default search.php template file to my child theme and commented out the template loop part and included a note to any visitor arriving on that page to our main page on the site.

    Nobody should ever get there, so I think that’s a good resolution to the problem. Thanks again!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to disable Search results page of ?s=’ is closed to new replies.