A search on search widget


I’ve been wishing for a WordPress widget that would help visitors find more blog content relevant to the search engine terms that got them to the blog in the first place. Maybe I’m just bad at googling or something, because I haven’t found one.

Now I’m writing my own widget, called “Search on search”. If you arrive at this blog from a search engine link you might see a section for it in the sidebar. If, not, and you’re curious you could force it by trying this search:

And then in the Google results find a link going to this site. (The widget doesn’t appear if it can’t figure out the search engine terms.)

You can find the widget code as a gist on Github, namely here:

It’s not rocket surgery. The main job is about figuring out what search engine terms, if any, that the user used to find the blog. But I didn’t need to solve that one either. Istanto had already solved it for me. =)

I still have a bug to iron out: The links presented doesn’t get styled like the other lists. I can’t figure out why… Feel invited to help me!

Update 17 January: The plugin is now available in the WordPress.org plugin directory:

, ,

2 Tweets

  1. #3 by Eugene on April 14, 2010 - 08:10

    Thanks PEZ,
    I found your plugin from http://www.istanto.net/phpcatching-keyword-from-search-engine.html. I was planning try to write plugin for WP by myself, but found yours ), it is even better than just keyword placing it also searching related posts. It just COOL. It would be fantastic if plugin was able to store latest search KW in DB and not disappear from next page visit. I know there are 2 similar plugings – SearchTerms Tagging and SEO Booster Pro but idea of Search on Search stand alone. Very love such creative coders. Hope will see new plugin release. Sorry for my English. Thank You. Eugene

  2. #4 by PEZ on April 14, 2010 - 10:56

    Wow, thanks Eugene! That’s wonderful feedback.

    About your suggested improvement it should be a fairly small fix. I think …. If we keep the referrer in a cookie and then when we look for search terms we check first the “real” referrer and if that one is empty we check the cookie. The rest of the code could be left as it is …

  3. #5 by Frendhy Arnen on October 2, 2010 - 08:55

    Hi Pez…
    I use your plugin,,, it’s cool…
    hhmmmpp…
    how to show result in my page…???

(will not be published)


Additional comments powered by BackType