Search Meter: a WordPress plugin

Saturday, 27 August 2005

Latest version is 2.13.4, released on 5 June 2021.

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

Compatibility

Search Meter is updated as necessary whenever new WordPress versions come out. The Search Meter page at the WordPress Plugins Directory has the latest compatibility information.

Install

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.

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

sm_list_popular_searches('

<code>

Popular Searches

')
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('

  • Popular Searches

    ', '

')
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('

  • Popular Searches

    ', '

', 10)
This is the same as the above, but it shows the 10 most popular searches.

sm_list_recent_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')) {
    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.

Contribute

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
1542gqyprvQd7gwvtZZ4x25cPeGWVKg45x

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.

1,505 comments

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

  1. Looks like I spoke too soon. The plugin seems to work fine. Awesome job again, great plugin. I guess the ‘hits’ means the number of results for a specific term, not necessarily the number of times it was clicked on or such. Thanks again!

  2. hi, i wrote a wrapper to make your plugin usable as a widget, check it out: http://faked.org/blog/wp-widget-wrappers/

  3. ..ist ein echtes “must” plugin für WP!

    Mike

  4. ..i tried it and can recommend it!

    Geoff

  5. I have translate your plugin in french : [edited: plugin code removed to save space]
    Hum… there is the translated plugin : http://www.wordpress-fr.net/support/viewtopic.php?pid=7178#p7178

  6. Thank you for the Great plug in!!!!

    I’d like to be able to save the searches into a text file. Rather than simply copying them.

    Thank you so very much!!

    Great job!

    Scott Gaines

  7. Hi,
    I’m getting database errors:

    WordPress database error: [Table 'user_wpdatabase_searchmeter' doesn't exist]
    DELETE FROM `wpdatabase_searchmeter` WHERE `date`
    Similar errors for the All Searches sub categories.

    Everything on my end looks correctly installed, but is there something I have to do to the database manually or perhaps modify the permissions on /includes/wp-db.php ?

    Thanks in advance for any suggestions. :)

    BTW:
    WP 2.02 with the following plugins:
    Alphabetical Plugins 1.03, baoCMS 1, Breadcrumb Navigation 0.8.81 , bsuite b2v3 Dec 14, Email Immunizer R1, Filosofo Home-Page Control 0.6, Get-a-Post R1.3 , Google Sitemaps 3.0b1 , ImageManager 2.3.7 , Improved Include Page 0.3, Jerome’s Keywords 1.9, Khanh’s Content Adder 2.0.1 , Khanh’s Instant Notepad 0.4.6 , Link Indication 1.4, List Subpages 1, Organizer 1.1.0 , Parent Pages 1.0.2 , Post Updated R1 , Role Manager 1.4.4 , Safe Include 1, Search Meter 1.1, Search Reloaded 2.2, Smart Link 2.3, Static Front Page 2.1, the_excerpt Reloaded R1 , Underscore Permalinks 1.0.1 ,
    Unfancy Quote 2, WordPress Database Backup 1.7

  8. John, it looks as if the Search Meter database table was never created. This is supposed to happen when you activate the plugin. (Do you know whether you have permission to create new database tables on your host?) Try deactivating and reactivating the plugin, if you haven’t already. I will think about how I can create a diagnostic version of Search Meter for you.

  9. Hi,

    When I tried to activate the plugin, I get the following message:

    Parse error: parse error, unexpected ‘{‘ in /home/domain_name/public_html/blog2/wp-content/plugins/search-meter.php on line 39

    where “domain_name” is the name of my web site.

    I couldn’t go back to the plug-in screen to deactivate the Search Meter plug-in. In fact, my entire Blog is showing the error message.

    I had to delete Search Meter directly from the plug-in directory before my entire Blog can be seen again.

    Any idea where I might have gone wrong?

    Thanks!
    Shaun

  10. Shaun, your copy of the file got corrupted somehow. Once that happens, you often have to delete the file to recover.

    I suggest trying again. If it still fails, tell me the exact steps you took to download and install the file. Hopefully I’ll be able to spot the problem.

  11. Hi

    Great plugin. Is there anyway to display mroe than 5 results and to also remove the ?

    Regards

    Everton

  12. Hello Bennett,

    I found a little problem with your software:

    A spammer has – how ever he does it – sent the following string to my blog’s search page:

    Hi! Good site [url=http://some.spammers-url.com

    I found it recently in my statistics. Well, currently it does not harm because I have no public search-words-list but I plan to do so. Does anyone know how to make it a bit more sure that the spammer cannot use his spam-software to fillin his webpage as a search key word?

    Quix0r

  13. Quix0r, this is not a problem. The Popular Searches list only shows searches that actually produce results. So “some.spammers-url.com” won’t show up in your Popular Searches unless you actually have a blog post containing that text. Nothing will appear in your Popular Searches unless it is already in your site anyway.

  14. Oopps, I found it out some minutes later I posted my previous message here. 🙁

    I don’t want to sound fussy but maybe you can add a “last-successful-search-term” function which displays the latest success search in the way “Last Post” or “Last Commentator” is?

    I guess this is very easy and will improve your already very-good plugin a little more. 🙂

    Or shall I do this for you?

    Quix0r

    PS: Sorry for my bad english but I have only school-english here.

Leave a comment