Searching for dynamic PHP search results isn't something the average user does. So, who is using inurl:search-results.php search 5, and why?

Include in the <head> of your search results pages:

<meta name="robots" content="noindex, nofollow">

This prevents Google from indexing the page while keeping it accessible to users.

Sometimes, developers leave debug messages visible in production. A page that literally displays search 5 might be outputting system information, such as:

Search 5 executed in 0.023 seconds using indexed memory.

This gives attackers insight into database structure, table names, or server configuration.