Support » Plugins and Hacks » [Plugin: Search Meter] highlight search terms?

[Plugin: Search Meter] highlight search terms?

  • This is a great plugin but just wondered whether it is possible to highlight the search term in the results page to make it easier for the user to see the term in context.

    Thanks for any help.

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author Bennett McElwee


    Search meter only gathers data about searches; it doesn’t change the way the results appear. There is very likely some other plugin that will highlight search terms — I’m sure you’ll find some if you search. 😉

    Hello Mr. Bennett,

    I installed Search Meter Plugin a few months ago.I am using Recent Searches widget on the sidebar.

    For example, one of recent search term with 4 words:
    gold toilet paper holder
    The link is: http://bathroomaccessorieset.com/search/gold%20toilet%20paper%20holder

    This means that Search for “gold%20toilet%20paper%20holder”
    The search result is: “Sorry, no posts matched your criteria.”

    If I simply change gold%20toilet%20paper%20holder into gold-toilet-paper-holder as below:
    It means Search for “gold toilet paper holder”
    There are many posts matching and showing on the search result pages.

    My question is, how to change permalink for the Search Terms with more than TWO WORDS. Changing the spaces html code “%20” into “-“, this looks easy, but very difficult for me.

    Can you please kindly teach me how to Change the spaces code “%20” into “-” on the link of recent search terms? This solution will be much helpful to SEO and visitors.

    Best regards,

    Plugin Author Bennett McElwee


    The URL

    should work, even if Search Meter is disabled. Please try disabling Search meter and then try the above URL. If it doesn’t work then it is likely that your theme or another plugin is preventing the URL from working. Please let me know what happens.

    Hi Bennett,
    I’d like to know, if is possible to use your plugin together with Google Custom Search which is installed on my site. Thx, Chris

    Hello Mr. Bennett,

    Thank you for your analysis.

    I tried to deactive or active SEARCH METER plugin, the result is the same – Nothing Found!

    To make a good test, I tried at another site:

    This site using WORDPRESS default theme: Twenty Ten 1.2.
    Only these plugins are actived: Akismet, All in One SEO Pack, Google XML Sitemaps, Search Meter. No more.

    You can visit my site: http://bathshower.co/
    on the lower right sidebar: Recent Searches
    You can see outdoor shower
    The link adress is http://bathshower.co/search/outdoor%20shower

    If I change into http://bathshower.co/search/outdoor-shower,
    that is a successful search!

    I believe you can revise the search links a little, simply change the SPACE code “%20” into “-“, everthing will be perfect!

    Best regards,

    Plugin Author Bennett McElwee


    Donald, you can probably get the effect you want by editing the search-meter.php file. Find line 140, which looks likethis:
    $relative_url = str_replace('%search%', rawurlencode($term), $structure);

    Add another line after it so they look like this:

    $relative_url = str_replace('%search%', rawurlencode($term), $structure);
    $relative_url = str_replace('%20', '-', $relative_url);

    This may work for you but it won’t work for all users. I will have to investigate a bit more to figure out how WordPress search works.

    Thank you very much, Mr. Bennett,

    It really works perfect!
    This is a Jiant improvement to SEARCH METER.
    All the best!

    Kind regards,

    Plugin Author Bennett McElwee


    I have investigated a bit more. This problem is actually due to a bug in WordPress (bug #13961). This bug should be fixed in WordPress 3.2. I will try to figure out a good way of working around it in Search Meter, but WP3.2 will probably be out by then anyway. 🙂

    Hello Mr. Bennett,

    You are right. The previous verions seems no such issues.

    I visited a site – http://www.samsung-phones.org/
    It is WordPress 3.1 verion.

    I do not if this site is using Search Meter plugin. But the SEARCH on left sidebar works very well.

    Best regards,

    Plugin Author Bennett McElwee


    Yes, they seem to have a feature that redirects the search to work around the WordPress bug.

    > I’d like to know, if is possible to use your plugin together
    > with Google Custom Search which is installed
    > on my site.

    I asked before and got no answer yet. What I mean: I use the Google Custom Search and not the WP-Search. Will Search Meter work anyway?

    Many Thanks for your answer! Chris

    Plugin Author Bennett McElwee


    Chris, if you use Google custom search then the search query gets sent to Google, so WordPress (and Search Meter) never sees the query. If you ‘re using Google custom search then you might have ot use something like Google Analytics to get search statistics.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘[Plugin: Search Meter] highlight search terms?’ is closed to new replies.