WPThumbs
Themes Plugins By purpose By industry Best-of lists Fix it guides
Free Plugin by Rolf Allard van Hagen v1.8.4

Highlight Search Terms

Very lightweight (vanilla) Javascript that wraps search terms in an HTML5 mark tag within WordPress search results.

Highlight Search Terms

The facts

Rating
5★ from 40
Active installs
7k+
Price
Free
Last updated
9 Jul 2026
Added
Apr 2009
Requires WP
3.7
Tested up to
WP 7.0.4
Requires PHP
5.6
Downloads
185,677

Our analysis

AI-assisted

Highlight Search Terms is a WordPress plugin that highlights search terms within the results of WordPress-generated searches. It works by marking the relevant terms on both the search results page and within the linked posts themselves, using a specific HTML5 tag for visibility.

This plugin is lightweight and does not have configuration options, making it suitable for users who prefer a simple solution. It is designed for compatibility with various themes and other plugins, although some basic CSS styling may be necessary for optimal visibility across different browsers.

Best for: This plugin is best suited for WordPress users looking to enhance search term visibility without complex settings.

What it does well

  • Highlights search terms on results and post pages
  • Lightweight with no configuration options
  • Compatible with WooCommerce, BuddyPress, and bbPress
  • Character and case insensitive highlighting
  • Caching compatibility with WP Super Cache

Where it falls short

  • No predefined CSS styles for highlighting
  • May require theme adjustments for full functionality

Verdict

Highlight Search Terms provides a straightforward solution for highlighting search terms, though users may need to implement their own styling for best results.

From the developer

Rolf Allard van Hagen's own description of Highlight Search Terms, lightly tidied.

Highlights search terms within WordPress generated search results, both on the search results page and on each linked post page itself.

This plugin is light weight and has no options. It started as very simple fusion between How to Highlight Search Terms with jQuery – theme hack by Thaya Kareeson and Search Hilite by Ryan Boren.

It has since evolved with many optimizations, HTML5 and other plugin compatibility. Since version 1.6 it no longer depends on the jQuery library.

Features

  • Click through highlights: Highlights not only on WP search results page but also one click deeper inside a post page
  • Character and case insensitive (lenient) highlighting
  • Caching (WP Super Cache) compatibility
  • Search terms wrapped in double quotes now considered as single term

Compatible with:

  • Woocommerce
  • Search Filter Pro
  • BuddyPress
  • bbPress

What does it do?

This low impact plugin finds all search terms on a search results page inside each post and highlights them with a <mark class="hilite term-N"> ... </mark> tag.
Note that N is a number starting with 0 for the first term used in the search phrase increasing 1 for each additional term used. Any part of a search phrase wrapped in quotes is considered as a single term.

What does it NOT do?

There are no CSS style rules set for highlighting. You are free to use any styling you wish but to make the highlights visible in browsers that do not support HTML5 like Internet Explorer 8 or older you absolutely need to define at least one rule.
Modern HTML5 browsers will use their own highlighting style by default, which usually is a yellow marker style background.

So what do I need to do?

In most cases, it should just work. But you can do two things to ensure backward browser and theme compatibility:

  1. Define CSS rules: There are no configuration options and there is no predefined highlight styling. You are completely free to define any CSS styling rules in your themes main stylesheet (style.css) or the Custom CSS tab if the WordPress theme customizer.
    You can find basic instructions and CSS examples in the FAQ’s.

  2. Check your theme: In most up to date themes (including WP’s own default theme) post and page content is shown inside a div with class hentry. This means search terms found in post and page content will be highlighted but not similar terms that accidentally show in the page header, sidebar or footer.
    If your current theme does not use the hentry class (yet), this plugin will look for IDs content, main and finally wrapper but if none of those are found, it will not work for you out of the box. See the last of the FAQ’s for ways to make it work.

Available hooks and filters

  1. hlst_query_vars – The array of WordPress query variables that the plugin will identify as a search query. Must return an array. Default: ['search_terms','bbp_search'] (WordPress abd bbPress search)

  2. hlst_input_get_args – An array of GET variables that the plugin will identify as a search query. Must return an array. Default: ['hilite'] (for click-through highlighting)

  3. hlst_selectors – The array of possible HTML DOM element identifiers that the script will try. The first viable identifier it finds elements of will be scanned for search terms to mark, the rest is ignored. So the order is important here! Start with the element closest to, but still containing all the post/page title, excerpt or content.

  4. hlst_events – The array of DOM event listeners that the inline script will watch for. Default: ['DOMContentLoaded','post-load'] (on Document Ready and for Jetpack Infinite Scroll and others).

  5. hlst_inline_script – The inline script that will be added to the plugin script file. Can be used to add to or alter the inline script. Must return a string.

Read the full description on the official page →

Tagged as

Alternatives

Other plugins for on-site search.

Ivory Search

Advanced WordPress custom search plugin. Provides Search Form Customizer, WooCommerce Search, AJAX Search &amp...

Free 100k+ installs 4.9★ (1,560)
FiboSearch

The most popular WooCommerce product search plugin. Gives your users a well-designed advanced AJAX search bar...

Free 100k+ installs 4.9★ (1,814)
Ajax Search Lite

The Best Ajax Live Search and Filter for WordPress. Live suggestions, Custom Post types, Custom fields, Catego...

Free 70k+ installs 4.8★ (264)
Advanced Woo Search

Advanced WooCommerce product search plugin. Search inside any product field. Support for both AJAX search and...

Free 70k+ installs 4.8★ (248)
SearchWP Live Ajax Search

Template powered live search for any WordPress theme. Does not require SearchWP, but will utilize it if availa...

Free 50k+ installs 4.7★ (37)
CrawlWP SEO

Improve your WordPress SEO with instant search-engine indexing, SEO insights, and indexing status tracking.

Free 30k+ installs 4.7★ (60)