How to Add OpenSearch to your Website or Blog

February 15, 2007 2 min read

The latest versions of Microsoft Internet Explorer and FireFox offer a powerful new feature: they allow you to run a search directly from the browser without having to open a Google or Yahoo page. This is handy and convenient, and can save us a few clicks for every search we run (several per day, in my case).

The new feature is based on an open standard called OpenSearch. It’s based on a simple yet effective idea:

  1. A website owner adds a little XML file to his/her website and a simple tag (auto-discovery link) to the main web pages describing a new search engine or a specific search option for an existing search engine.
  2. As new generation web browsers visit the website, they automatically recognize the tag and load the XML file.
  3. The XML file is parsed and, if syntactically correct, a new entry is temporarily added as an option to the search menu of the web browser.
  4. The visitor/user can customize the web browser adding the new search option as a permanent entry of the search menu.

It’s very simple. If you don’t have a new search engine running on your servers, you can set up the OpenSearch configuration to run a search on your website using Google as the search engine.

First you have to create the simple XML file. I suggest you start from a template. The one I use is below (thanks to DeWitt Clinton):

<?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
<ShortName>[Site Name]</ShortName>
<Description>Use Google to search [Site Name]</Description>
<Tags>[Site Name]</Tags>
<Url type="text/html" template="http://www.google.com/search?q=site:[Site URL] {searchTerms}"/>
</OpenSearchDescription>

Now you have to replace [Site Name] with your website name and [Site URL] with your website URL. Here is the Novedge XML file:

<?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
<ShortName>Search Novedge</ShortName>
<Description>Use Google to Search NOVEDGE</Description>
<Tags>NOVEDGE</Tags>
<Url type="text/html" template="http://www.google.com/search?q=site:novedge.com {searchTerms}"/>
</OpenSearchDescription>

Save the XML file with the .xmlextension, and copy it onto your website. Now you only need to add a simple tag to the HEAD section of your web pages. This is the template of this auto-discovery link:

<link rel="search" href="[XML File URL]" type="application/opensearchdescription+xml" title="[Site Name]" />

For example, here is the Novedge auto-discovery link:

<link rel="search" href="/opensearchdescription.xml" type="application/opensearchdescription+xml" title="Search NOVEDGE" />

Now you’re done! Refresh your browser and then check it. Here is what you should see (FireFox):

From now on all your visitors will have the choice to add a search to your website as a standard option of their web browser. At Novedge, for example, we believe this is important. We have a huge catalog with more than 1500 products so we’d love to make our catalog searchable through Google.
You can try OpenSearch on our Novedge website.  If you decide to add this feature to your website let me know by leaving a comment to this post. For more details about OpenSearch, please visit the OpenSearch pages on Wikipedia or the OpenSearch website.

Franco Folini

Franco Folini
Franco Folini


Also in NOVEDGE Blog

Mastering 2Shapes For Rhino With Great New Tutorials
Mastering 2Shapes For Rhino With Great New Tutorials

October 13, 2021 1 min read

The first 9 video tutorials to master 2Shapes for Rhino have been published. You have no excuses!
Read More
Get A Universe Of Assets With The Latest  V-Ray 5 for Cinema 4D Update
Get A Universe Of Assets With The Latest V-Ray 5 for Cinema 4D Update

October 12, 2021 1 min read

With the latest update of V-Ray for Cinema 4D you also get an universe of assets optimized for any workflow and ready-to-render via Chaos Cosmos. 

Read More
Why An Autodesk Multi-Year Subscription Makes Good Business Sense
Why An Autodesk Multi-Year Subscription Makes Good Business Sense

October 08, 2021 1 min read

A 3-year subscription to Autodesk software might be the best return on investment, locking the price for three years and allowing you to save 10% upfront.

Read More

Subscribe