Title: Search Analytics for WP
Author: Cornel Raiu
Published: <strong>March 2, 2018</strong>
Last modified: March 18, 2026

---

Search plugins

![](https://ps.w.org/search-analytics/assets/banner-772x250.jpg?rev=1832550)

![](https://ps.w.org/search-analytics/assets/icon-256x256.jpg?rev=1832550)

# Search Analytics for WP

 By [Cornel Raiu](https://profiles.wordpress.org/cornelraiu-1/)

[Download](https://downloads.wordpress.org/plugin/search-analytics.1.4.16.zip)

 * [Details](https://wordpress.org/plugins/search-analytics/#description)
 * [Reviews](https://wordpress.org/plugins/search-analytics/#reviews)
 *  [Installation](https://wordpress.org/plugins/search-analytics/#installation)
 * [Development](https://wordpress.org/plugins/search-analytics/#developers)

 [Support](https://wordpress.org/support/plugin/search-analytics/)

## Description

Search Analytics for WP will keep history of the search terms used by your users
and group them in a set of statistics including the number of posts resulted from
that search term.

It can easily aid you in finding what your users are really searching for on your
website and make sure you provide exactly what they need.

Help and/or ideas are greatly appreciated! You can contribute to the GitHub repository:
[Search Analytics for WP](https://github.com/cornelRaiu/search-analytics)

**NOTE: Search Analytics for WP stores all the statistics in your WordPress database.
No info is sent to third-party services!**

#### Features

 * Record all the search queries made using the **standard WordPress search form**.
 * Exclude searches made by **users with certain user roles** or **with certain 
   IP addresses**
 * Exclude duplicate searches made **in certain conditions**
 * Choose which user roles are allowed to see the statistics
 * Filter statistics by **time periods, with/without results, strings/substrings**
 * View each term **individual statistics**
 * **Export data** in the current view to CSV
 * Easily **delete certain search terms** from history
 * Easily **erase all history from the database** in case a reset is needed
 * Easily **erase history older than** in case a general cleanup is needed
 * Dashboard widget for a quick glance over your last week’s search stats
 * **Multisite compatible**
 * Country Geolocation
 * Display search statistics on the front of your website using shortcodes

## Screenshots

 * [[
 * Main statistics view with time filters
 * [[
 * Export data to CSV
 * [[
 * Single term statistics view
 * [[
 * Single term statistics view with results grouped by date
 * [[
 * Settings page
 * [[
 * Dashboard widget
 * [[
 * Erase history section in the settings page

## Installation

Search Analytics for WP can be installed via the WordPress Automatic Plugin Install
page in the admin panel.
 It can also be downloaded from the WordPress Plugin Directory
and installed manually.

After the installation and activation is complete you should visit the plugin’s 
settings page ( Settings -> MWT: Search Analytics ) to make sure it is properly 
configured for your needs.

## FAQ

### The search history on my website is not being saved

The plugin works with the standard WordPress search functionality by default. However,
if you need to you can add custom search queries in the plugin’s settings or, why
not, programmatically add searches to the plugin’s database tables to be displayed
in the admin panel. For other requirements, please use the [Support Forum](https://wordpress.org/support/plugin/search-analytics)
or open new issues on the GitHub repository: [Search Analytics for WP](https://github.com/cornelRaiu/search-analytics).

### The shortcode is not displaying the stats in widgets

For enabling the shortcodes in widgets you need to add the following code in your
child theme’s `functions.php` file:

    ```
    add_filter( 'widget_text', 'do_shortcode' );
    ```

### The history was not deleted when I deactivated the plugin

Before uninstalling, you should go to the plugin’s settings page and check the “
Remove plugin tables on uninstall” setting. After doing that, deactivating the plugin
should also remove all tables from the database.

### Where can I make feature requests or report non-security related bugs?

You can use the [Support Forum](https://wordpress.org/support/plugin/search-analytics)
or open new issues on the GitHub repository: [Search Analytics for WP](https://github.com/cornelRaiu/search-analytics).

### Where do I report security bugs?

Please report security bugs found in the source code of the Search Analytics for
WP plugin through the [Patchstack Vulnerability Disclosure Program](https://patchstack.com/database/vdp/search-analytics).
The Patchstack team will assist you with verification, CVE assignment, and notify
me, the developer of Search Analytics for WP.

## Reviews

![](https://secure.gravatar.com/avatar/d2f9bcf57d02703d25641ce7d3eb7bcd49b07645ca1f4223fbfb995751547ad1?
s=60&d=retro&r=g)

### 󠀁[Great plugin, prompt reply and fix](https://wordpress.org/support/topic/great-plugin-prompt-reply-and-fix/)󠁿

 [Diiamo](https://profiles.wordpress.org/luislu/) September 17, 2025

Great plugin, prompt reply and fix

![](https://secure.gravatar.com/avatar/e8571dc8970066a55fc31c320d3ed65b8fd17d2af22526517106f66624471b78?
s=60&d=retro&r=g)

### 󠀁[Exactly what I need!](https://wordpress.org/support/topic/exactly-what-i-need-177/)󠁿

 [alexpalshin](https://profiles.wordpress.org/alexpalshin/) April 23, 2025 1 reply

The plugin is exactly what I need! Also I really appreciate help from the author
who has advised me how to connect the plugin to my custom theme! It saved me days
of research! Thank you very much!!

![](https://secure.gravatar.com/avatar/6aa81a1090ec58eeb81d7dd90faba10f10478160f9d0a9ffd4ca0d56c51b5193?
s=60&d=retro&r=g)

### 󠀁[I totally recommend it](https://wordpress.org/support/topic/i-totally-recommend-it/)󠁿

 [blacknetro](https://profiles.wordpress.org/blacknetro/) April 23, 2025 1 reply

A very useful module to understand your customers’ desires and needs.

![](https://secure.gravatar.com/avatar/f92f53c11c99aee215d3edd4ed2df8bf3aec2117ab4dce85e2a574fdace4d41c?
s=60&d=retro&r=g)

### 󠀁[Good](https://wordpress.org/support/topic/good-8631/)󠁿

 [OniX777](https://profiles.wordpress.org/onix777/) September 19, 2024

Great plugin, thanks!

![](https://secure.gravatar.com/avatar/5a02e9e268255021130e8448fda54e2672360d2536e2e8bc4d123caf551b86c0?
s=60&d=retro&r=g)

### 󠀁[POWERFULL plugin that help to understand the user intenssion](https://wordpress.org/support/topic/powerfull-plugin-that-help-to-understand-the-user-intenssion/)󠁿

 [sami770](https://profiles.wordpress.org/sami770/) August 23, 2024

Dear dev – you did a fantastic job with this plugin!!

![](https://secure.gravatar.com/avatar/1b67d93bd5d5b1a22d36e06f2ce9979c01e5fa6c0b8573a9c6960453d48d8bd0?
s=60&d=retro&r=g)

### 󠀁[It’s a great plugin](https://wordpress.org/support/topic/its-a-great-plugin-78/)󠁿

 [antimine](https://profiles.wordpress.org/antimine/) February 1, 2024 2 replies

It’s intuitive to use and has everything you really need.Plugin developers provide
quick feedback on any issues.very good plugin.

 [ Read all 30 reviews ](https://wordpress.org/support/plugin/search-analytics/reviews/)

## Contributors & Developers

“Search Analytics for WP” is open source software. The following people have contributed
to this plugin.

Contributors

 *   [ Cornel Raiu ](https://profiles.wordpress.org/cornelraiu-1/)

[Translate “Search Analytics for WP” into your language.](https://translate.wordpress.org/projects/wp-plugins/search-analytics)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/search-analytics/),
check out the [SVN repository](https://plugins.svn.wordpress.org/search-analytics/),
or subscribe to the [development log](https://plugins.trac.wordpress.org/log/search-analytics/)
by [RSS](https://plugins.trac.wordpress.org/log/search-analytics/?limit=100&mode=stop_on_copy&format=rss).

## Changelog

#### 1.4.16

 * Bugfix: Fix bug related to exclude keywords setting, reported [here](https://wordpress.org/support/topic/there-has-been-a-critical-error-on-this-website-422/).
   Thank you [@luislu](https://wordpress.org/support/users/luislu/) for the report!

#### 1.4.15

 * Bugfix: Fix country not being saved, reported [here](https://wordpress.org/support/topic/country-data-unavailable/).
   Thank you [@mikeeiler](https://wordpress.org/support/users/mikeeiler/) for the
   report!

#### 1.4.14

 * Bugfix: Fix bulk deletion not working.

#### 1.4.13

 * Optimization: Security improvements and general code optimization.

#### 1.4.12

 * Others: Rename plugin to “Search Analytics for WP”

#### 1.4.11

 * Optimization: Security improvements and general code optimization. Fixed Reflected
   Cross-Site Scripting vulnerability reported by [vgo0](https://www.wordfence.com/threat-intel/vulnerabilities/researchers/dale-mavers)

#### 1.4.10

 * Optimization: Security improvements and general code optimization. Fixed Broken
   Access Control vulnerability reported by [Abdi Pranata](https://patchstack.com/database/researcher/92634a85-0e66-4059-aff6-1de1c49d0964).
   Thank you for the responsible disclosure!
 * Optimization: **Compatibility with WP 6.6.x**

#### 1.4.9

 * Bugfix: Fixed warnings showing on specific combination of filters and grouping.
   Reported [here](https://wordpress.org/support/topic/bug-undefined-array-key-count/).
   Thank you [@sadesades](https://profiles.wordpress.org/sadesades/) for the detailed
   report!

#### 1.4.8

 * Optimization: (ENCORE) Security improvements and general code optimization. Fixed
   [this vulnerability](https://www.wordfence.com/threat-intel/vulnerabilities/wordpress-plugins/search-analytics/wp-search-analytics-146-reflected-cross-site-scripting-via-render-stats-page)
 * Optimization: adjust some translations

#### 1.4.7

 * Optimization: Security improvements and general code optimization. Fixed [this vulnerability](https://www.wordfence.com/threat-intel/vulnerabilities/wordpress-plugins/search-analytics/wp-search-analytics-146-reflected-cross-site-scripting-via-render-stats-page)

#### 1.4.6

 * Optimization: Security improvements and general code optimization. Fixed [this vulnerability](https://www.wordfence.com/threat-intel/vulnerabilities/wordpress-plugins/search-analytics/wp-search-analytics-145-authenticated-administrator-stored-cross-site-scripting)
 * Bugfix: Charts not working after changing interval or chart type

#### 1.4.5

 * Bugfix: Fix PHP Compatibility issue: PHP 5.6 – 7.2

#### 1.4.4

 * Bugfix: Date filters not working if the browser is set in a language different
   from English
 * Feature: Add setting: “Show results dates as UTC”, default: true
 * Feature: Make dates in the results list show as UTC by default.
 * Feature: Add 6 more filters and 2 actions for developers to be able to extend
   the plugin. An overview post will be published here: [Search Analytics for WP: Filters Reference](https://www.cornelraiu.com/search-analytics-filters-reference/)
 * Optimization: Security improvements and general code optimization
 * Optimization: Updates to the settings page
 * Deprecations: Deprecated the `mwt_wp_date_format_to_js_datepicker_format()` helper
   function

#### 1.4.3

 * Bugfix: Make sure that shortcode **mwtsa_display_latest_searches** displays unique
   terms
 * Feature: Add more parameters to some filters. An overview post will be published
   here: [Search Analytics for WP: Filters Reference](https://www.cornelraiu.com/search-analytics-filters-reference/)

#### 1.4.2 Hotfix

 * Bugfix: fix default filters in the results view

#### 1.4.1

 * Feature: Add shortcode **mwtsa_display_latest_searches** for displaying the latest
   searches on the frontend of the website
 * Feature: Add 3 more filters for developers to be able to extend the plugin. An
   overview post will be published here: [Search Analytics for WP: Filters Reference](https://www.cornelraiu.com/search-analytics-filters-reference/)
 * Optimization: Security improvements and general code optimization
 * Others: Add link to the complete changelog

#### 1.4.0

 * Feature: Add REST API search support
 * Feature: Add 9 filters for developers to be able to extend the plugin. An overview
   post will be published here: [Search Analytics for WP: Filters Reference](https://www.cornelraiu.com/search-analytics-filters-reference/)
 * Optimization: Add the search term to the **mwtsa_extra_exclude_conditions** filter
 * Optimization: Check for minimum PHP and WP versions when activating the plugin
 * Optimization: **Compatibility with WP versions up to 6.0.1**
 * Optimization: **Compatibility with PHP v8.1**
 * Optimization: Security improvements and general code optimization
 * Bugfix: Fix styling on WP 4.4.0 – 4.9.20
 * Bugfix: Fix broken settings page URL from the results page
 * Others: Rename the plugin to “WP Search Analytics”

#### 1.3.6

 * Bugfix: Users can not see the statistics page in some cases. [Bug report](https://github.com/cornelRaiu/search-analytics/issues/3)
 * Bugfix: Database error on term delete success page
 * Optimization: **Compatibility with WP versions up to 5.8**
 * Optimization: **Compatibility with PHP versions between 5.6 – 8.0**
 * Optimization: Security improvements and general code optimization
 * Optimization: Remove filters and groups on the term delete success page
 * Others: Add more “Useful Links”
 * Others: Add quick rate tool

#### 1.3.5

 * Bugfix: Fix dates filter not allowing you to select the current day in certain
   timezones
 * Bugfix: Deleting multiple entries with the bulk action would trigger 2 notices
 * Feature: Add support for WpForo
 * Feature: Add **mwtsa_export_filename** filter to allow control over the filename
   generated when exporting data
 * Feature: Add shortcode **mwtsa_display_search_stats** for displaying search statistics
   on the frontend of the website
 * Optimization: Prepare the plugin for community translation
 * Optimization: Security improvements and general code optimization

#### 1.3.4 Hotfix

 * Bugfix: Fix fatal error for missing `wp_timezone()` in WP < 5.3.0

#### 1.3.3

 * Bugfix: Times displayed in UTC time instead of the website’s timezone
 * Feature: allow filtering searches by user
 * Experimental Feature: prevent terms from being saved if they contain certain 
   substrings
 * Experimental Feature: allow the plugin to capture search strings from custom 
   search parameters
 * Optimization: hook **load_plugin_textdomain** on the **init** action instead 
   of the **plugins_loaded** one
 * Optimization: prefix helper functions **create_date_range** and **get_current_user_ip**
   with **mwt_** to avoid eventual naming conflicts

#### 1.3.2

 * Bugfix: “Only display the statistics and settings page for these user roles” 
   not working correctly
 * Bugfix: Fix missing script error if charts disabled
 * Bugfix: Add prefix to the option setting group to prevent conflicts
 * Bugfix: Database error if search-term URL param is empty
 * Feature: Split the “Only display the statistics and settings page for these user
   roles” in 2 different settings
 * Optimization: **compatibility with WP versions up to 5.4**
 * Optimization: Add prefix to the option setting group to prevent conflicts
 * Optimization: Review and patch the plugin from a security perspective
 * Optimization: Made sure administrator display rights can not be taken away by
   making the field disabled

#### 1.3.1 Hotfix

 * Bugfix: database not being updated correctly in case of plugin update. It only
   worked for manual plugin activation
 * Bugfix: search country locked to Canada.

#### 1.3.0

 * Feature: add **save_search_term()** method to allow external search saving
 * Feature: add **mwtsa_extra_exclude_conditions** filter to allow more control 
   over the conditions in which a search is processed
 * Feature: add **mwtsa_exclude_term** filter to allow more control over the conditions
   in which terms are saved
 * Feature: save searches by user so the user can see his search history
 * Feature: add country geolocation for the searches
 * Feature: add more options for the chart
 * Feature: add period comparison in the chart
 * Optimization: **compatibility with version 5.2.2**
 * Optimization: **Add multisite support**
 * Optimization: Build separate methods for displaying charts to be able to easily
   integrate it in other views
 * Optimization: Make chart include “today”
 * Optimization: general code optimizations
 * Optimization: general code optimizations

#### 1.2.3

 * Feature: add ability to delete all search history older than a selected number
   of days
 * Feature: add setting: “Exclude searches from IPs list”
 * Feature: add setting: “Only record searches with at least the number of characters”
 * Feature: add “Ungroup” view for the list of terms for having a chronological 
   data view
 * Optimization: **compatibility with version 5.1**
 * Optimization: change default sort to last search date
 * Optimization: average number of results column to only 2 decimals
 * Optimization: update the singleton pattern

#### 1.2.2

 * Bugfix: fix bug in the database version update
 * Bugfix: “By Hour” group is not working correctly
 * Bugfix: “Hide graphical charts” setting not working correctly
 * Feature: Add a setting for using a cookie for previously logged in user for not
   counting searches made by users having a user role in the excluded roles list
 * Feature: Add a setting for not counting duplicate searches over a period of time
 * Feature: add role visibility for the dashboard widget
 * Optimization: update the way Group By works on the term details view
 * Optimization: use function_exists() and class_exists() for all function/class
   declarations
 * Optimization: add javascript graph compatibility with older IE versions
 * Optimization: show fewer points on the Y axis on the graphical chart if search
   count gets high

#### 1.2.1

 * Bugfix: fix “Unknown column ‘average_posts’ in ‘where clause’” error on single
   term view ( introduced in v1.2.0 )
 * Bugfix: remove bulk actions on single term view ( introduced in v1.2.0 )
 * Bugfix: fix “Last 24 hours” time filter ( introduced in v1.2.0 )
 * Feature: add admin dashboard widget with last week stats
 * Feature: add possibility to group single term view results by day and hour
 * Feature: add charts for graphical data representation
 * Optimization: add link on searched term for faster navigation
 * Optimization: make custom views and filters language variables ( introduced in
   v1.2.0 )
 * Optimization: make all date and time columns use WP date and time format settings
 * Optimization: code updates to better comply to the WP coding standards

#### 1.2.0

 * Bugfix: fix PHP notice on the settings page ( introduced in v1.0.3 )
 * Bugfix: fix search resetting time and result filters ( introduced in v1.1.2 )
 * Bugfix: fix notice “Undefined index: date_from” ( introduced in v1.1.2 )
 * Bugfix: fix notice “Undefined index: date_to” ( introduced in v1.1.2 )
 * Feature: ability to download history in a CSV file
 * Feature: add single term view with detailed search historical stats
 * Feature: ability to choose which user roles can see the search history stats
 * Optimization: set table names in plugin constants for cleaner calls
 * Optimization: move history data return from db function to independent static
   class.
 * Optimization: change time filter default to “All Time”

#### 1.1.3

 * Bugfix: fix jquery.ui load over https ( introduced in v1.1.2 )

#### 1.1.2

 * Bugfix: make stats page full responsive ( introduced in v1.1 )
 * Feature: add filters: all, only successful, only unsuccessful ( 0 posts ) results
 * Feature: Time range filters
 * Optimization: make bulk action “Delete” use language variable ( introduced in
   v1.1.1 )
 * Optimization: add screen option to allow selection of number of results per page
 * Optimization: last search date – sortable column
 * Optimization: add “clear” option to the date pickers
 * Optimization: add 2 months view on the calendars

#### 1.1.1

 * Bugfix: remove limit of results on the table ( introduced in v1.1 )
 * Feature: ability to delete terms from the results
 * Feature: bulk terms delete action
 * Optimization: results per page reduced from 30 to 20

#### 1.1

 * Bugfix: exclude empty search strings ( introduced in v1.0 )
 * Design: display tables using the WordPress Admin Tables
 * Feature: pagination for better data analysis
 * Feature: custom sorting on all columns
 * Feature: filter results by string

#### 1.0.4

 * fix a warning occurring in certain cases on search

#### 1.0.3

 * Add ability to delete all history
 * Add ability to remove the tables on plugin deactivate
 * Stats page restyling

#### 1.0.2

 * Update results sorting for better viewing the data
 * Minimum styling on the stats page
 * Add link to the settings page

#### 1.0.1

 * Fix deprecated notice

#### 1.0

 * Initial Release

## Meta

 *  Version **1.4.16**
 *  Last updated **4 weeks ago**
 *  Active installations **3,000+**
 *  WordPress version ** 4.4.0 or higher **
 *  Tested up to **6.9.4**
 *  PHP version ** 5.6 or higher **
 * Tags
 * [analytics](https://wordpress.org/plugins/tags/analytics/)[history](https://wordpress.org/plugins/tags/history/)
   [search](https://wordpress.org/plugins/tags/search/)[statistics](https://wordpress.org/plugins/tags/statistics/)
 *  [Advanced View](https://wordpress.org/plugins/search-analytics/advanced/)

## Ratings

 5 out of 5 stars.

 *  [  29 5-star reviews     ](https://wordpress.org/support/plugin/search-analytics/reviews/?filter=5)
 *  [  1 4-star review     ](https://wordpress.org/support/plugin/search-analytics/reviews/?filter=4)
 *  [  0 3-star reviews     ](https://wordpress.org/support/plugin/search-analytics/reviews/?filter=3)
 *  [  0 2-star reviews     ](https://wordpress.org/support/plugin/search-analytics/reviews/?filter=2)
 *  [  0 1-star reviews     ](https://wordpress.org/support/plugin/search-analytics/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/search-analytics/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/search-analytics/reviews/)

## Contributors

 *   [ Cornel Raiu ](https://profiles.wordpress.org/cornelraiu-1/)

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/search-analytics/)