Tidying up the Joomla! search module

December 5, 2009

The out-of-the-box Joomla! search facility is a trifle off-putting. Users enter a search term in the search module input box and an overly complicated form appears:

The best means I have found of simplifying this form is as follows:

  1. In the administrator section of your Joomla! site select Menu Manager from the Menus dropdown.
  2. Select New to create a new menu.
  3. Give your new menu the unique name "hiddenmenu" and the title "Hidden Menu". Do not fill in the Module Title field or place the menu in a module – it’s meant to stay hidden!
  4. Click Save.
  5. Select Hidden Menu from the Menus dropdown.
  6. Click on New to add an item to this menu.
  7. Elect to create a standard search layout form.
  8. Title the form "Search Results". Set Use Search Areas to No and save it.
  9. Now use your favourite FTP client (e.g. FileZilla) to download from your website a copy of the file /modules/mod_search/tmpl/default.php
  10. Open that file with a text editor (e.g. Notepad++). The 3rd line from the top of the file should read: <form action="index.php" method="post">
  11. Change that to: <form action="index.php?option=com_search&view=search" method="post"> <!-- Changed from index.php to index.php?option=com_search&view=search -->
  12. Now go back into your FTP client and in the directory of your template create a /html/mod_search/ directory (if it doesn’t already exist). So if, for instance, your template is "my_template", your new directory will be /templates/my_template/html/mod_search/
  13. Upload the modified default.php file to that directory.

You should now find that entering a search term in the search module input box brings up a slightly cleaner form:

If you have followed these steps and still see those extra check boxes you might find that the problem is due to the popular sh404SEF component. To fix this, go to the administrator section of your website, click on sh404SEF from the Components dropdown (assuming that the component is installed) and then click the Purge SEF URLs button.

The above has worked for me in Joomla 1.5.0 and 1.5.14.