How To: Make a Firefox Search Plugin for a WP Site

After 9rules released their comprehensive new search feature on Monday, allowing users to search member content and receive results from Flickr, YouTube and Technorati, it was only a matter of time before someone created a Firefox search plugin. This got me thinking that it would be pretty cool if PaulStamatiou.com readers could have that same convenience. Well now you can, and I'm going to show you how to make one for your WordPress-powered blog as well.

The Mycroft site, which stores a repository of Firefox search plugins, has a basic outline of how to make a working plugin. However, to get it working with WordPress you will need to change a few items. First off, every search plugin has two parts: the source file, which is converted to XML once you upload it to Mycroft, and search image. I'm not sure what image file types the search plugin can take but it seems to work well with GIF's and PNG's. Both of these files must be named the same, with the exception of the file type. For example, my files are named PSsearch.gif and PSsearch.src.

The main thing that needed to be changed for WordPress compatibility was the search query which goes by index.php?s= instead of using query. Below is the code I changed from the Mycroft tutorial; the rest of it stayed the same.

<search version="7.1"
 name="PaulStamatiou.com Search"
 description="PaulStamatiou.com - Tech News/Reviews/Guides" 
 action="https://paulstamatiou.com/index.php"
 searchForm="https://paulstamatiou.com/index.php"
 method="GET"
 >

<input name="sourceid" value="Mozilla-search"/>
<input name="s" user/>

<browser update="http://mycroft.mozdev.org/update.php/id0/PSsearch.src" 
 updateIcon="http://mycroft.mozdev.org/update.php/id0/PSsearch.gif" 
 updateCheckDays="7" 
></browser></search>

When you're done with that, submit your plugin with this tool. Once everything is uploaded, do a quick search on Mycroft to find your plugin and install it. That being said, go ahead and try out my search plugin. I decided to convert my site's favicon and use it with the search plugin for consistency. Overall I think it turned out quite well for something that took me a few minutes of work. A great addition to any blog.

PaulStamatiou.com Search

Alternatively, you can host the search plugin on your site using JavaScript and a properly constructed link as done on UNEASYsilence in the sidebar.

Like it? Tweet it.

"How To: Make a Firefox Search Plugin for a WP Site" by @Stammy

Get new articles via email