How to change the default search queries in Opera by editing search.ini and buttons.ini

You don't like Opera's default queries? Well, it's your browser, change them, it's easy! What do you need? Nothing but a text editor and some time.

Basically, all you have to do, is edit search.ini. Want to adjust the little search buttons on the personal bar, too? Well, edit buttons.ini. Hey, you can even change the Encyclopedia, Dictionary and other Hotclick searches. :) Let's get started.

Andrzej Olaczek translated most parts of this document to Polish. Andrzej is also the author of the Opera Search.ini Editor (read more about it). j353840 did a Czech translation of the search.ini documentation. Thank you.

Hier findet ihr meine aktuelle search.ini auf deutsch (für Opera 8.50). Die Zeitschrift c't berichtet in c't 2002, Heft 12 ab Seite 222 darüber, wie Suchmaschinen in Opera integriert werden können.

Most of the following information applies to both Opera 6.02 for Windows and Opera 6.0 for Linux. It has been tested with Opera 6.02 Final for Windows (build 1101) and Opera 6.0 Final for Linux build 161. There are some differences though: mainly the bugs are missing in the Linux version. ;-)

Beta versions of Opera 7 have been released. Your custom search.ini should still work but new entries and bugs were introduced. Opera added three new keys: Position, Verbtext and Nameid. These keys get added if the Personal bar was modified. I will update this guide after the final version of Opera 7 has been released. Right now, I suggest to read the following two news postings by Andrzej Olaczek and to use his Opera Search.ini Editor to add and verify search engines for Opera 7:

If you haven't already done so, please download the latest Opera version for your operating system.

search.ini

Before you start, create a backup copy of the original search.ini file. Then start your favorite text editor (e. g., notepad on Windows; vim on Linux) and open search.ini. Have a look at the first (slightly edited) search entry. I added line numbers and if you want to jump straight to an explanation of one specific line, just click the line number in front of it. Want to jump back to the top? Just click the line number again.

  1  ; This file is part of the Opera browser.
  2
  3  [Search Engine 1]
  4  Name=&Google
  5  URL=http://www.google.com/search?q=%s&num=%i
  6  Query=
  7  Key=g
  8  Is post=0
  9  Has endseparator=0
 10  Encoding=utf-8
 11  Search Type=0

Might look complicated at first, but it's not that hard to understand. I will try to explain what each line means.

  1  ; This file is part of the Opera browser.

This is a comment. You can add comments to explain something but you can also comment-out searches you want to replace. If you want to comment out a search, put a semi-colon ; in front of each lines of this query.

  3  [Search Engine 1]

This entry determines the order in which Opera will list the search entries in its dialogs, e. g., in Preferences or when right-clicking the personal bar.

Caution: Opera will use [Search Engine 1] and [Search Engine 2] when you use Super search. So it makes sense to list Super as [Search Engine 3], although you don't have to. You don't know what Super search is? Try it!

Notes:

If some of your Search Engines are listed in the Hotclick dialog and in Preferences but are not displayed on the Personal bar, it's because of missing Key entries.

  4  Name=&Google

This entry determines the name that Opera will use on its dialogs. It will also get displayed in the search field on the personal bar. The ampersand & denotes the mnemonic (some call it accelerator or shortcut key). The ampersand is also responsible for the underlined G in Google on some dialogs. I don't think you can use Alt+G anywhere to access Google but you can use G as accelerator on some dialogs.

  5  URL=http://www.google.com/search?q=%s&num=%i

This entry is the URL of the query. It will get displayed in the address bar after you execute the query. There are two parameters: %s and %i. %s will get replaced by the search string you enter in the search field on the personal bar (or the high-lighted word if you execute a query using the Hotclick or right-click menu), %i will get replaced by the Preferred number of search results per page or by zero 0 if you haven't set one up in the Preferences dialog. If you want to use %i and haven't set up a Preferred number of search results per page, make sure the search engine returns more than zero results.

Caution: Jacob Cappell noticed that a URL entry that has the %i written before the %s will cause Opera 6.0x for Windows to crash when a query is attempted by the user.

Note: If Is post=1 is set, you would put the query part in the Query= line. Read on to find out more.

  6  Query=

This entry contains the query string. It will only get used if Is post=1 is set! In that case you would put the query part of the URL here. For Amazon.de, this could result in URL=http://www.amazon.de/exec/obidos/search-handle-form/, and Query=url=index%3Dbooks-de&field-keywords=%s&size=%i. The query part will not appear in the address bar after you execute the query because the query gets submitted using post. Since the Google example uses Is post=0, this setting has not been set.

  7  Key=g

This entry contains the Keyword. Entering g Opera will search for Opera using the Google search engine. If you use the Keyword as mnemonic in the Name, e. g., &Google, it's easier for you to remember them.

Keywords are case sensitive (Linux version only), that means you could use "Key=g" for Google and "Key=G" for something else. Keywords can indeed be words (Windows version only), so you could assign "Key=cnn" to a query to CNN and search CNN using "cnn Afghanistan Enron Bush Conspiracy".

Keywords have to be unique. Duplicates will be ignored.

If you leave the Key setting empty, this Search Engine and all subsequent engines (the latter might be a bug) will not get displayed on your Personal bar. This makes it possible to "hide" the Hotclick and Translation searches.

  8  Is post=0

This entry determines how the query will get sent to the server. If Is post=0 the query string will get passed on in the URL and the query will get submitted using get. If Is post=1 the query string will not get passed on in the URL and the query will get submitted using post. If Is post=1 you will have to fill in the Query= line.

The German meta search engine MetaGer doesn't allow GET queries. Philipp Orth sent a sample entry for MetaGer.de (replaces the MP3 search).

  9  Has endseparator=0

Has endseparator illustrated If set, there will be a separator after the search entry on some dialogs. Separators group related items, e. g., on the left image, you will notice an end separators (horizontal rule) after Paperball.

 10  Encoding=utf-8

This entry sets the character encoding of International characters in your search query. For example, if set to Encoding=utf-8, Opera would encode your query using Unicode UTF-8 encoding. If you were searching for g König, Opera would replace the umlaut ö and submit K%C3%B6nig instead. This setting depends on the search engine you are using. If you have problems with International characters, try changing this to Encoding=iso-8859-1 or some other settings. Have a look at the content of Encoding » in the View menu on the menu bar.

 11  Search Type=0

Please be careful with this entry, since some Search Types have a special meaning:

This setting also affects the little search buttons on the personal bar. Search Type=X uses the icon of the SearchX entry in buttons.ini.

You can use up to 16 different icons (Search00 to Search15) and you can reuse icons, for example, Search Type=0 works fine for all customized searches.

buttons.ini

In buttons.ini you can adjust the icons for the little search buttons on the personal bar. If you use Opera's standard button set, you will probably find buttons.ini in C:\Programme\Opera\Buttons\Standard\ (Windows) or /usr/share/opera/buttons/standard/ (Linux).

144  [PERSONALBAR]
[...]
150  Search00             = search_web.png

Section [PERSONALBAR] contains some Searchn=image entries. Searchn=image will look for the icon file image in the current directory and display it for Search Type n.

Example search.ini and buttons.ini

Let's have a look at my current search.ini and buttons.ini files. Right-click on the file name and select Save target as.... These files have been adjusted for German users.

Here are some screen-shots that will show the final results. Note: I have updated my search.ini and buttons.ini, but I am too lazy to take new screen-shots. Just download the ini-files and you'll see. :)

This is how the personal bar will look:

alternative search: items one to five on personal bar
alternative search: items six to ten on personal bar
alternative search: items 11 to 14 on personal bar

This is how the right-click search menu will look. Notice the end separator after some entries.

alternative search items on right click menu

This is how the search entries in the View menu will look:

alternative search items on view menu

This is how the drop-down search menu on the address bar will look:

alternative search items on drop-down search menu on the address bar

This is how the Preferences will look. It also shows the "Initial" (Keyword).

alternative search items on Preferences dialog

Original search.ini and buttons.ini

In case you messed up, here the original search_1101_orig.ini and buttons_1101_orig.ini files. Right-click on the file name and select Save target as.... You will have to rename the files back to search.ini and buttons.ini, respectively.

Backup your newly created search.ini and buttons.ini

The next time you update or re-install Opera, your customized search.ini and buttons.ini files will get replaced by Opera's default versions. Opera for Windows will create backups in C:\Programme\Opera\UnInst\Backup. Your search.ini files will be renamed to search.001, search.002, ... But I still recommend to backup all changed ini files before updating Opera. Better save than sorry. ;-)

Opera Search.ini Editor

In case all you really wanted was some easy to use search.ini editor, have a look at Andrzej Olaczek's Opera Search.ini Editor. It's easy to use and really helpful. He offers Czech, English, French, German, Japanese, Polish, Russian, and Spanish language files, and a lot of pre-defined search engines.

If you have problems accessing his server, try downloading the Opera Search.ini Editor from a German mirror.

Feedback/Questions

If you have any questions, feel free to ask. Feedback will gladly be appreciated. Please send an e-mail if you think there is information missing or incorrect.

27. September 2005
Martin Schrode <webmaster @ schrode . net>
http://www.schrode.net/opera/search/search_ini.html

[Home] [Sitemap]