WP Manifestindependent plugin directory
manifest / content / wp-search-highlight

Search Highlight

Highlights searched terms on WordPress search results pages, tag-safe with a wsh_terms filter

★ 0stars

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/azanumer/wp-search-highlight/archive/refs/heads/main.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

Highlights the terms a visitor searched for on WordPress search results pages, so they can see at a glance why each result matched.

Features

  • Tag-safe highlighting — HTML is split on tags and only text nodes are searched, so attributes and markup can never be broken.
  • Longest-term-first — multi-word phrases highlight as one phrase before their single-word parts.
  • Case-insensitive, Unicode-aware matching.
  • Content + excerpts — highlight in post content by default, or extend to excerpts from Settings → Search Highlight.
  • wsh_terms filter — themes/plugins can adjust the term list.
  • One CSS rule — the default yellow <mark> style is printed on search pages only and is trivially overridden by a theme.

Installation

  1. Upload the plugin folder to wp-content/plugins/.
  2. Activate it. Search your site and watch the terms light up.

License

MIT — see LICENSE.