Search Meter: a WordPress plugin

Saturday, 27 August 2005

Latest version is 2.11, released on 17 September 2015.

Search Meter is a WordPress plugin that helps you keep your blog focused on what your visitors want to read. It does this by keeping track of what your visitors are searching for.

If you have a Search box on your blog, Search Meter automatically records what people are searching for — and whether they are finding what they are looking for. Search Meter’s admin interface shows you what people have been searching for in the last couple of days, and in the last week or month. It also shows you which searches have been unsuccessful. If people search your blog and get no results, they’ll probably go elsewhere. With Search Meter, you’ll be able to find out what people are searching for, and give them what they want by creating new posts on those topics.

Search Meter includes a Dashboard widget so you can see the last week of searches right on your WordPress Dashboard.

You can also show your readers what the most popular searches are. The Popular Searches widget displays a configurable list of recent popular successful search terms on your blog, with each term hyperlinked to the actual search results. There’s also a Recent Searches widget, which simply displays the most recent searches. If you are happy to edit your theme, both of these functions are also available as template tags.

Search Meter installs easily and requires no configuration. Just install it, activate it, and it starts tracking your visitors’ searches. Here’s a screenshot of the Search Meter dashboard, showing some of the reports you’ll get.

Search Meter dashboard


The latest version of Search Meter works with WordPress versions from 3.2 to 4.3, and should also work with newer versions as they are released.


Log in to your WordPress administration console. Under Plugins, select Add New. Type Search Meter in the box and the rest should be easy.

You can also download the Search Meter files from the WordPress Plugin Directory. You can download older version of the plugin, or check the development version for the latest unreleased goodies.

View Statistics

To see your search statistics, Log in to WordPress Admin, go to the Dashboard section and click Search Meter. You’ll see the most popular searches in the last day, week and month. Click “Last 100 Searches” or “Last 500 Searches” to see lists of all recent searches.

Manage Statistics

There are a couple of management option available if you go to the Settings section and click Search Meter. Use the Reset Statistics button to clear all past search statistics; Search Meter will immediately start gathering fresh statistics. If you’re technically-minded, you might want to check the “Keep detailed information” checkbox to make Search Meter save technical information about every search (the information is taken from the HTTP headers).

Popular and Recent Searches

The Popular Searches widget displays a list of the most popular successful search terms on your blog during the last 30 days. The Recent Searches widget displays a simple list of the most recent successful search terms. In both cases, the search terms in the lists are hyperlinked to the actual search results; readers can click the search term to show the results for that search. Also, you can configure the title and the maximum number of searches that each widget will display.

To add these widgets to your sidebar, log in to WordPress Admin, go to the Appearance section and click Widgets. You can drag the appropriate widget to the sidebar of your choice, and configure the title and the number of searches to display.

Widget support depends on the version of WordPress and the theme you’re using. In some cases you will not be able to use the widgets. In any case, you can always use the Search Meter template tags to display the same information. You’ll need to edit your theme to use them.

The sm_list_popular_searches() template tag displays a list of the 5 most popular successful search terms on your blog during the last 30 days. Each term is a hyperlink; readers can click the search term to show the results for that search. Here are some examples of using this template tag.

Show a simple list of the 5 most popular recent successful search terms, hyperlinked to the actual search results.

sm_list_popular_searches('<h2>Popular Searches</h2>')
Show the list as above, with the heading “Popular Searches”. If there have been no successful searches, then this tag displays no heading and no list.

sm_list_popular_searches('<li><h2>Popular Searches</h2>', '</li>')
Show the headed list as above; this form of the tag should be used in the default WordPress theme. Put it in the sidebar.php file.

sm_list_popular_searches('<li><h2>Popular Searches</h2>', '</li>', 10)
This is the same as the above, but it shows the 10 most popular searches.

Show a simple list of the 5 most recent successful search terms, hyperlinked to the actual search results. You can also use the same options as for the sm_list_popular_searches tag.

If you add these to your theme, wrap them in a function_exists call so your theme won’t break if you deactivate Search Meter. It should look something like this:

if (function_exists('sm_list_popular_searches')) {

Problems, questions or requests?

If you use the Recent Searches or Popular Searches widgets, you may be affected by a WordPress bug that stops multi-word search links from working.For more information and a way to fix the problem, see my Search Fixer plugin to ensure the search links always work.


The source code is maintained on the Search Meter github repository. You know the drill: fork, hack, send a pull request, and bask in the warm glow of satisfaction that is open source.

If you find any problems, please let me know by leaving a comment at the bottom of this page. You can also leave a comment if you have any questions about how it works, or if you would like to request a feature.

I write these WordPress plugins because I enjoy doing it, but it does take up a lot of my time. If you think this plugin is useful, please consider donating some appropriate amount.

Click here to donate using a credit card or PayPal.

Send Bitcoins to address

Full WordPress plugin list

  • Code Markup — Quickly paste code samples into your posts -- you can even include HTML markup in the code sample.
  • Evermore — Automatically display a short preview of your posts on the home page and other multiple-post pages, along with a link to the full post.
  • FixBack — Ensure trackbacks and pingbacks are sent with the correct link back to your blog.
  • Less — Less is no more. It has been renamed to Seemore and moved to its own Seemore plugin page.
  • Plaintext — Allow your readers to download source files (e.g. PHP, HTML, ASP) as plain text.
  • Safe Title — Use HTML in post titles in the default WordPress theme (or any other theme).
  • Search Meter — Find out what people are searching for on your blog, so you can write what your visitors want to read.
  • Seemore — Change the (more...) link so it jumps to the full post, not just the part after the link.
  • Top Cat — Specify a main category for your posts, and use template tags to display posts differently according to their main category.
Be Sociable, Share!


You can leave a comment, or trackback from your own site.

  1. If I have a dedicated server on the site that has your plugin, then I guess it would not be a problem with performance?

    Now, let’s say I change the history from 500 to 10,000, where do I get the data from? what database name?

    Thanks Bennett

  2. Hi, thanks for the plug in. I had a problem with the permalink part: /search/
    Coz I also use german letters like (ä,ß, etc.) there was a search problem in my website. if i want to search ex. fräßen,äßen could be found in the results page. Because search-meter shows the latest searches, and after i click on fräßen in widget (which isäßen) it couldn’t be found. Therefore, to whom, who has same problem, want to tell the solution.

    1- Open the search-meter.php
    2- Find this part:
    // Return the URL for a search term, relative to the home directory.
    global $wp_rewrite;
    $relative_url = null;
    if ($wp_rewrite->using_permalinks()) {
    $structure = $wp_rewrite->get_search_permastruct();
    if (strpos($structure, ‘%search%’) !== false) {
    $relative_url = str_replace(‘%search%’, rawurlencode($term), $structure);

    3- change %search% parts (there is only 2), with %?s=

    After this, if you click on any earlier-searched-words in your widget, the wordpress will be able to find the search results. (Ok, other one is better for seo, but it is better, that it works like this :) )

    I hope, i could help anyone right here!

    Thank you again for this plug-in, have a nice day!

  3. Hello every one… This plugin worked for me earlier.. and I dont see the searches in table or dashboard list from last 4 months.. What could be the reason?? I tried by checking putting ‘echo and exit’ in the plugin file – With that I can tell you the plugin file is not calling… Please let me know whats causing this issue.. Plugin writer should have faced this problem already… Thanks in advance for your help

    – Chandu

  4. Hello,

    Very nice plugin! I love it! I use it in the sidebar. Wanted to use it in the header, not as a widget but simply using the php code as you suggested, but it showed nothing at all.


    Thanks and best regards,


  5. I’ve just found your plugin and will test it right now. Is there option that results of your plugin are included in main site dashboard with other widgets

  6. Hi, I’d like to report a bug… I think Alper A is talking about it.

    I am using the following Permalink personalized structure:


    I also have a page for showing the user searches:

    the searched keywords are shown correctly but the links are not right if the search is longer than one word. Like: “SEXY WOMEN” 😀

    see here:

    it tries to go to post and gets the NOT FOUND error

    however, the WP Search form goes to:

    and it works.

    Please advice… I wouldn’t like to update the plugin myself anytime you release a new version.


  7. hi again, I think this is a wordpress bug, if using personalized permalinks…

    won’t work…

    nor something


    the search form gets you to the non personalized permalink:

    even though you are using personalized permas…

    I think you can work it around by replacing blanks with + in the terms string. And also, when you save a search remove + characters from it for not saving it twice… once with spaces and once with + characters….

    kind-of dumb… but worpress is inconsistent that way …

    I opened a WP but… let’s see what they say

  8. @Bogdan, have a look at my Search Fixer plugin. I think this will solve your problem.

  9. Hello,

    How did you come up with the idea behind this plugin?

    I’m curious its quite nice.


  10. hai this is haripriya,

    how can we give links to the seaches {popular} was taking search term not the category ..pls reply me i have a problem..

    when ever we click on popular search category it shows
    for eg: Search for ‘business%20services’ returned 0 results

    Sorry, no listings were found.
    pls reply me how to rectify the prblm

  11. @ haripriya, have a look at my Search Fixer plugin. I think this will solve your problem.

  12. Thank you so much for great “Search Meter”.

  13. I really like this plugin.

    But Is there a way to include unsuccessful terms as well in the popular and recent searches (in the widgets). I want to account for this on the front end too..


  14. Great plugin! Here is a suggestion: click to sort on (amount of) results so I have the most searched query on top of the list.

  15. recent search results are not showing up in home page or sidebar any suggestions?

  16. Nice Plugin.
    Installed it on a Classified Ads website and put the Popular searches widget on the home page.
    Now as you know a Classified Ads website has different categories with diff search terms.
    My Q is: Is there a way I can have category specific Popular search widgets? Thats like having many instances of the widget to cater for all the diff categories/sub categories

  17. How does the plugin check, if a search was successful or not? Does successful mean, that someone clicked on a search entry or does it mean, someone stayed on the page for a certain number of seconds? :)

  18. Hi, I’d like to show also the unsuccessfull searches in the widgets. What I have to change in the code?

  19. Hi, thanks for the great plugin. I’ve been messing around a while with this and i would like to exclude some IP-adresses like an ip filter. Is this possible?

Leave a comment