Introduction

You can easily create a browser search plugin for your blog, that any visitor can add to their own browser, that will allow them to run a search on your site - from any other site!

I have the search code on my site. If your running Firefox 2 or Internet Explorer 7, you’ll notice the browser’s search button is lit up:

Firefox 2: Search From Firefox

Internet Explorer: Search From Internet Explorer

This is telling you, the visitor, that this site has a search plugin. You can click the down arrow and add the search plugin to your browser. Now, where ever you are - what ever site - you can enter a search term and you will be brought here and the search will be ran!

Read more instructions on Adding New Search Engines To Your Browser.

Why Should I Add This To My Site?

Why not? Give your visitors a way to return to your site! Plus, there is the “I can’t remember the date, but remember the name” factor. Let’s say your on another site and you are reminded of something you saw here months ago. Just enter the term and hit the search button!

How To Create Your Own Search Plugin

It’s actually really easy to do! All you need to do is create a file named search.xml and fill in the required information. The bare minimum that the file needs is:

  1.  
  2. <?xml version="1.0" encoding="UTF-8" ?>
  3. <OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
  4. <ShortName>Samanathon</ShortName>
  5. <Description>Search Samanathon.com for Windows Tips, Tricks And Hacks!</Description>
  6. <Tags>Samanathon Window XP Tip Trick Vista Secret Hidden Pro Registry Hack Registry Modification Backup Edit Command Prompt </Tags>
  7. <Image width="16" height="16" type="image/png">http://www.samanathon.com/favicon.ico</Image>
  8. <Url type="text/html" template="http://samanathon.com/?s={searchTerms}" />
  9. </OpenSearchDescription>
  10.  

Obviously, you need to change some information to fit your needs! Also, keep in mind that, the way the code above is writen, the URL Type tag will work for WordPress. If you are using another platform, you need to check how your code submits a search. Just run a search, pay attention to the URL that is returned, and replace it. WordPress uses:

http://samanathon.com/?s={searchTerms}

Where {searchTerms} represents the search term. Again, if you are a WordPress user, you don’t need to change the structure, just the domain name. Now, upload it to the root of your site! Mine lives at:

http://samanathon.com/search.xml

I Want More!

There are much more information you can add to the plugin that I won’t cover, but you can read about it on the OpenSearch spec site. I have added more info to mine, here is the code that I run:

  1.  
  2. <?xml version="1.0" encoding="UTF-8" ?>
  3. <OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
  4. <ShortName>Samanathon</ShortName>
  5. <Description>Search Samanathon.com for Windows Tips, Tricks And Hacks!</Description>
  6. <Contact>thebest@samanathon.com</Contact>
  7. <Tags>Samanathon Window XP Tip Trick Vista Secret Hidden Pro Registry Hack Registry Modification Backup Edit Command Prompt </Tags>
  8. <Image width="16" height="16" type="image/png">http://www.samanathon.com/favicon.ico</Image>
  9. <Url type="text/html" template="http://samanathon.com/?s={searchTerms}" />
  10. <Developer>Saman Sadeghi</Developer>
  11. <Attribution>Search Data Copyright Samanathon.com</Attribution>
  12. <AdultContent>false</AdultContent>
  13. <Language>en-us</Language>
  14. </OpenSearchDescription>
  15.