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


Leave a comment

Comments will be approved before showing up.

Also in NOVEDGE Blog

CYPE, Technical Software for Architecture, Engineering and Construction Hits the American Market-NOVEDGE
CYPE, Technical Software for Architecture, Engineering and Construction Hits the American Market

June 24, 2020 2 min read

CYPE occupies a leading position within the AEC sector, offering a variety of programs that stand out. CYPE is hitting the US market and we couldn't be more excited.
Read More
View and Exchange 3D Data in a Multi-CAD world with CAD Exchanger-NOVEDGE
View and Exchange 3D Data in a Multi-CAD world with CAD Exchanger

June 12, 2020 5 min read

CAD Exchanger helps Engineers (including Product Designers and Software Developers) understanding each other in a multi-CAD world.
Read More
Test Drive the Best CAD Workstations-NOVEDGE
Test Drive the Best CAD Workstations

June 02, 2020 3 min read

Read More

Subscribe