=== Better Search Pro ===
Contributors: webberzone, Ajay
Tags: search, Better Search, related search, relevant search, relevance
Donate link: https://wzn.io/donate-wz
Stable tag: 4.5.4
Requires at least: 6.9
Tested up to: 7.1
Requires PHP: 7.4
License: GPLv2 or later

Better Search replaces the default WordPress search with a better search engine that gives contextual results sorted by relevance.

== Description ==

Supercharge your WordPress site search with __[Better Search](https://webberzone.com/plugins/better-search/)__ – a powerful replacement for the default WordPress search engine that delivers more relevant results and a richer search experience.

Better Search gives you complete control over your site’s search results. Fine-tune relevance, search across different fields and post types, track popular queries, and customise the output — all without writing a single line of code.

Make your search more intuitive and engaging with a search heatmap of popular queries, display results as users type with AJAX Live Search, and tailor the look to your theme with custom templates and styles.

Built with performance in mind, Better Search includes its own caching system and works smoothly with popular caching plugins like WP Super Cache and W3 Total Cache. It also features a profanity filter and is translation-ready for global use.

## Awesome features in Better Search:

* __Automatic__: Just activate the plugin and enjoy better search results right away
* __Seamless integration__: No need to edit any code or create custom search templates
* __Relevance__: Sort the results by relevance or date, and assign different weights to title and content
* __Control the results__: Search within title, content, excerpt, meta fields, authors, tags and other taxonomies and comments
* __Popular searches__: Show a heatmap of the most popular searches on your site, either as a widget or a shortcode
* __AJAX Live Search__: Show search results as you type in any search form on your site
* __Customisation__: Use your own template file and CSS styles for the ultimate look and feel
* __Supports cache plugins__: Works seamlessly with caching plugins like WP-Super-Cache and W3 Total Cache
* __Profanity filter__: Filter out any words that you don't want to appear in search queries
* __Translation ready__: Use the plugin in any language

If you want to improve your site search, download Better Search today and experience the difference for yourself.

## Features in Better Search Pro

[__Better Search Pro__](https://webberzone.com/plugins/better-search/pro/) gives you even more control and performance:

* 🗄️ [Efficient Content Storage and Indexing](https://webberzone.com/support/knowledgebase/efficient-content-storage-and-indexing/)
* 🔍 [Multisite Search](https://webberzone.com/support/knowledgebase/multisite-search/)
* ✨ [Fuzzy Matches](https://webberzone.com/support/knowledgebase/fuzzy-matches/)
* 🎯 [Relevance Threshold](https://webberzone.com/support/knowledgebase/better-search-settings-search/#minimum-relevance-percentage-pro-only)
* 🔗 [Search Post Slugs](https://webberzone.com/support/knowledgebase/better-search-settings-search/#search-post-slug-pro-only)
* ⚙️ [REST API Integration](https://webberzone.com/support/knowledgebase/better-search-rest-api/)
* 🔄 [LIKE Fallback Search](https://webberzone.com/support/knowledgebase/better-search-settings-search/#enable-like-fallback-pro-only)
* ⚖️ [Advanced Relevance Weighting](https://webberzone.com/support/knowledgebase/better-search-settings-search/#post-excerpt-pro-only)

## MySQL FULLTEXT indices

Better Search adds the following MySQL FULLTEXT indices to the `wp_posts` table:

* `post_content`
* `post_title`
* `(post_title, post_content)`

On multisite, these are added to each blog upon activation. These indices power the relevance-based search and are required for full functionality.

## Contribute

Better Search is also available on [Github](https://github.com/WebberZone/better-search). If you've got some cool feature you'd like to implement into the plugin or a bug you've been able to fix, consider forking the project and sending me a pull request.

## Plugins by WebberZone

Better Search is one of the many plugins developed by WebberZone. Check out our other plugins:

* [Contextual Related Posts](https://wordpress.org/plugins/contextual-related-posts/) - Display related posts on your WordPress blog and feed
* [WebberZone Link Warnings](https://wordpress.org/plugins/webberzone-link-warnings/) - Add accessible warnings for external links and target="_blank" links
* [Top 10](https://wordpress.org/plugins/top-10/) - Track daily and total visits to your blog posts and display the popular and trending posts
* [Knowledge Base](https://wordpress.org/plugins/knowledgebase/) - Create a knowledge base or FAQ section on your WordPress site
* [WebberZone Snippetz](https://wordpress.org/plugins/add-to-all/) - The ultimate snippet manager for WordPress to create and manage custom HTML, CSS or JS code snippets
* [Auto-Close](https://wordpress.org/plugins/autoclose/) - Automatically close comments, pingbacks and trackbacks and manage revisions on your WordPress site

= Multilingual sites =

Better Search supports WPML and Polylang and detects TranslatePress's current language when caching search results. Caches are separated by language so results from one language are not reused in another.

TranslatePress translates the displayed results with the rest of the page; it does not create a separate search index of translated text. Better Search Pro's core WordPress REST search responses and live-search suggestions are translated using the active TranslatePress language.

Search-term highlighting can prevent TranslatePress from translating a complete title because it splits the text with markup. Disable search-term highlighting if translated titles remain in the default language.

== Screenshots ==

1. Better Search Dashboard
2. Better Search Popular Searches table in Admin
3. Better Search widget

== Installation ==

= WordPress install =
1. Navigate to Plugins within your WordPress Admin Area.

2. Click "Add new" and enter "Better Search" in the search box.

3. Find the plugin in the list (usually the first result) and click "Install Now".

= Manual install =
1. Download the plugin

2. Extract the contents of better-search.zip to wp-content/plugins/ folder. You should get a folder called better-search.

3. Activate the Plugin in WP-Admin.

4. Goto **Settings > Better Search** to configure

== Frequently Asked Questions ==

If your question has not been covered here, please create a new post in the [WordPress.org support forum](https://wordpress.org/support/plugin/better-search). I monitor the forums regularly. If you want more advanced _paid_ support, please see [details here](https://webberzone.com/support/).

= Will this work with any WordPress theme? =  
Yes! It replaces the default WordPress search and integrates with most themes out of the box.

= Does it support WooCommerce or custom post types? =  
Yes, you can enable searching in any public post type from the settings.

= How does it affect performance? =  
Better Search uses MySQL FULLTEXT indexes and includes internal caching. It also works well with external caching plugins.

= Can I customise the search results template? =  
Yes, you can override the results template by copying the file to your theme directory. More info in the [documentation](https://webberzone.com/support/knowledgebase/better-search-templates/).

= What is the Profanity Filter? =  
It filters out selected keywords from being searched. Handy for family-safe sites.

Better Search includes a very cool profanity filter using the script from [Banbuilder](https://github.com/snipe/banbuilder). You can customize which list of words you want to filter out from the Better Search settings page. Find the setting called "Filter these words:". The plugin will automatically strip out partial and complete references to these words. You can turn the filter off by emptying the list.

= How can I report security bugs? =

You can report security bugs through the Patchstack Vulnerability Disclosure Program. The Patchstack team help validate, triage and handle any security vulnerabilities. [Report a security vulnerability.](https://patchstack.com/database/vdp/better-search)

== Changelog ==

= 4.5.3 =

Release date: 1 November 2026

**Added**

* [Pro] List of posts that failed to index in Tools, with a Retry button. WP-CLI reindexing now exits with an error when any post fails.

**Changed**

* Replaced the layout table in the search results header with a CSS Grid, so screen readers no longer announce it as a data table. Custom CSS targeting its `table`, `tr` or `td` elements needs updating.

**Security**

* Restricted the `post_type` search parameter to searchable post types, so revisions of draft, private and password-protected posts, and internal content such as menu items, no longer appeared in front-end search results.
* Excluded attachments of unpublished posts and of post types visitors cannot view from search results, and attachments of password-protected posts when "Exclude password protected posts" was enabled.
* [Pro] Applied the same rules to the LIKE fallback and Did You Mean auto-correct, which had returned revisions, these attachments and, to logged-in users, password-protected posts.

**Fixed**

* On attachment pages, and in search results that included an attachment, posts without a featured image used that attachment as their thumbnail.
* Attachment searches served from the cache returned no results.

= 4.5.2 =

Release date: 15 October 2026

**Security**

* Prevented thumbnail fallbacks from using images inside or attached to password-protected posts before the password was entered.
* Hardened thumbnail URLs to reject unsafe protocols.

**Fixed**

* Malformed custom thumbnail dimensions caused PHP errors during image-size selection.

= 4.5.1 =

Release date: 12 October 2026

**Added**

* [Pro] Ask AI in theme search forms, plus model settings for AI answers with a Compare models window.

**Changed**

* Cached searches with no matches, refreshing them when posts changed.
* [Pro] Renamed ECSI to Efficient Content Storage and Indexing.
* [Pro] Reused cached AI answers for reworded questions until their source posts change.
* Updated Freemius SDK to the latest version.

**Fixed**

* Searches raised a PHP 8.5 deprecation warning while loading stopwords.

= 4.5.0 =

Release date: 2 October 2026
Release post: https://webberzone.com/announcements/better-search-v4-5/

**Added**

* WordPress Abilities API support for site searches, with an option to disable it in the Features tab.
* Status section in Tools showing database, index and cache health.
* Setting to restrict search results to selected terms.
* `*` wildcard support in filtered words, so `spam*` also blocked "spammer".
* Translated titles and language-specific links in TranslatePress live-search suggestions.
* `data-bsearch-live-search="off"` form attribute, so forms with their own live search did not show a second list of suggestions.
* [Pro] Abilities for popular search terms, spelling suggestions and cache clearing.
* [Pro] Optional AI answers grounded in Better Search results, with source links, cached answers, usage limits and a Content gaps report.
* [Pro] WP-CLI commands for AI questions, answer-cache management and Content gaps.
* [Pro] Expanded Tools status with custom-table and AI-provider health.
* [Pro] Optional recency weighting, disabled by default; existing custom-table indexes required a one-time backfill from Tools.
* [Pro] Optional ranking weights for slug, metadata, author and comment matches.
* [Pro] Wildcard search redirects, so `help*` could match multiple search phrases.

**Changed**

* Raised the minimum WordPress version to 6.9 for the Abilities API.
* Improved keyboard and screen reader access to settings and repeater controls.
* [Pro] Expanded include and exclude settings to all public taxonomies.
* [Pro] Improved custom-table search performance on large sites.
* [Pro] Moved the REST API search setting to the Features tab.

**Security**

* Hardened thumbnail dimensions to prevent markup injection through custom image sizes.

**Fixed**

* Cached search results could appear in the wrong language on WPML, Polylang and TranslatePress sites.
* Searches covering taxonomies, metadata, authors or comments could time out on large sites.
* Common words were not excluded on sites without a Better Search translation.
* Network search caches remained stale after settings changes or manual cache clearing, and nested queries could prevent caching.
* Cache-clearing confirmation and error messages were missing.
* Live search suggestions could reopen after pressing Escape or submitting the search.

= Earlier versions =

For the changelog of earlier versions, please refer to the [releases page on GitHub](https://github.com/WebberZone/better-search/releases).

== Upgrade Notice ==

= 4.5.3 =
Security release. Stops front-end search from returning revisions of draft, private and password-protected posts, and attachments of unpublished posts. Update as soon as you can. Pro users with custom tables should reindex them from the Tools page.

= 4.5.2 =
Security release. Hardens password protection in thumbnail fallbacks and rejects unsafe thumbnail URLs. Also fixes errors with malformed thumbnail dimensions. Update recommended.

= 4.5.1 =
Faster Pro AI answers with a choice of model, better answer caching, and fixes for Pro AI crashes with ECSI. Adds Ask AI to theme search forms. Update recommended for all users.

= 4.5.0 =
Security and performance release. Adds optional Pro AI answers and ranking controls, and fixes multilingual caching and search accuracy. Requires WordPress 6.9 or later.
