0

I've been searching thru all WordPress files for the phrase "search result for", which is displayed on the search result page (search result for (keywords)) but can't find it.

I would like it to be: "You searched for: (keywords)"

Does anybody know where and how to change this?

2
  • the string is with an 's' on results - 'search results for'. Looks like it's in the language files so could be edited there or with a child theme perhaps
    – mozboz
    Jul 10, 2020 at 12:37
  • This would depend entirely on how your theme is constructed. I suggest asking its author. Jul 10, 2020 at 14:21

1 Answer 1

-1
add_filter('document_title_parts', function($parts){
    if( is_search() ){
        $parts['title'] = sprintf('You searched for: %s',get_search_query());
    }
    return $parts;
});
5
  • well, WordPress didn't crash, but my text didn't change...
    – JoBe
    Jul 10, 2020 at 13:26
  • @JoBe how you search template file calls?
    – Az Rieil
    Jul 10, 2020 at 14:03
  • how do I do what?
    – JoBe
    Jul 10, 2020 at 14:23
  • What is name of search template file you using? Its your theme or you working with existing?
    – Az Rieil
    Jul 10, 2020 at 14:25
  • I'm using hello by elementor...
    – JoBe
    Jul 10, 2020 at 15:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.