There is most likely a problem with escaping HTML in your code. You might be doing something like this: echo esc_html("Search Results for: <span>search_word</span>"); Instead, use `printf` or only wrap your search word with `esc_html()`: printf('Search Results for: <span>%s</span>', esc_html( $search_word ) );