| 开发者 | adamstevenson |
|---|---|
| 更新时间 | 2026年7月17日 08:03 |
| PHP版本: | 7.2 及以上 |
| WordPress版本: | 7.0.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
[search_hero_search post_type="product"] shortcode for a search box on any page, and the same instant results appear on the admin post list, where they take you straight to the editor.
What gets indexed
Every public post type that is searchable: posts, pages, custom post types, and products. Each one is indexed into its own tables, so Products can be rebuilt without touching Posts, and a rebuild of one leaves the rest searchable throughout. Choose which ones on the settings page; developers can narrow or widen the choices with the search_hero_indexed_post_types filter.
It stays up to date on its own
Index once after installing. From then on, publishing, editing, unpublishing, trashing, restoring and deleting content all update the index as they happen. There is nothing to re-run.
No external service
The index lives in your own database. Nothing about your content is sent anywhere, there is no API key, and there is no per search cost.
wp search-hero index
To rebuild just one kind of content:
wp search-hero index --section=productNo. New and edited content is indexed as you save it. Indexing by hand is only for the first run, or if you want to rebuild from scratch.
Yes. Any public post type that is searchable can be indexed, each into its own tables, and you choose which ones on the settings page. Each search covers a single kind: a product search returns products, a post search returns posts. WordPress already tells the plugin which one from the search itself, so a WooCommerce product search reaches the product index automatically.
No, by design. A search covers one post type. Content of different kinds is indexed separately and never mixed into one list, because how well something matches is only meaningful next to others of the same kind. Point a search box at the type you want with the shortcode's post_type attribute, or let the query decide.
Yes, for this release. Relevance scoring and the stored index both changed, so run Rebuild Index (or wp search-hero index) once after updating.
Searching reads a compact index rather than scanning your posts table, so it gets faster relative to the built in search as your site grows. Indexing is the expensive part, and it only runs when content changes.
[search_hero_search post_type="..."] shortcode and the admin post list are covered too.