How to Create an Autodiscovery Blog Search for Web Browser
Have you add LiewCF blog search to your web browser? Many readers are excited by the feature. I will show you how to create an auto discovery blog search for web browsers. WordPress used in this example.

Add LiewCF blog search to your web browser (FireFox 2 in this example)
Table of Contents
The OpenSearch technology
We are using OpenSearch technology for the auto discovery blog search. OpenSearch is a collection of simple formats for the sharing of search results. Currently, both Internet Explorer 7 and Firefox 2 support this feature. Please refer to OpenSearch.org for technical documents.
Overview
It is easy to create an autodiscovery search for web browsers. We need to create a simple xml file and add a line of code into your web page’s header. That’s all. Read on for details.
Note: This tutorial is for WordPRess blog. You might need to modify the code to work with your blogging platform.
Creating OpenSearch XML file
Now, we create a XML file which would be read and added into user’s web browsers.
- Create a new plain text file
- Paste the following lines of code into it:
[xml]< ?xml version="1.0"?>
[/xml]
YOUR_BLOG_NAME
YOUR_BLOG_DESCRIPTION
YOUR_BLOG_LONG_NAME
- Replace these terms in the code with yours:
- YOUR_BLOG_NAME — the name of your blog
- YOUR_BLOG_DESCRIPTION — tell people about your blog
- YOUR_BLOG/PATH — your blog path
- YOUR_BLOG_LONG_NAME — a longer blog name
- Save the file as “myopensearch.xml”
- Upload “myopensearch.xml” to your WordPress blog root.
Blog search auto discovery
In order to make web browsers auto discover our blog search, we need to add a <link/> tag into page header.
- Open “header.php” of your WordPress theme.
- Find: [html][/html]
- So, it will look like this:
[html][/html] - Save “header.php” and upload back to your WordPress theme folder.
You’re done! Back to your blog and add the blog search to your web browser. :)
References: Heath Stewart’s Blog and Mozilla Developer Center
Bonus: WordPress OpenSearch plugin — add OpenSearch RSS feed functionality to a WordPress blog. (Does not include browser AutoDiscovery)
Thanks for the tutorial Liew. Will be adding the blog search to my blog as well now :)
Thanks so much for a great tutorial! I hate to ask a really dumb question, but for those of us who just follow you instructions because we have no idea what we’re doing…
When I save the file as myopensearch.xml with Note Pad, what encoding do I use? UTF-8, Unicode? Does it make a difference?
Thanks so much for helping to make Happiness more visible!
@Michhele Moore: UTF-8 or Unicode doesn’t matter because the code is standard alphabet characters.