Joomla Web Development Articles
Last Updated on Saturday, 17 December 2011 16:52 Written by Joomla Web Developer Saturday, 17 December 2011 16:49
How to increase and override the maximum search word character limit in Joomla 1.5 to search for 21 characters or more. Reposting this very useful tip for hacking a common, default search limitation in Joomla 1.5... follow completely and in detail. Before doing below steps always ensure you have a backup of the files to be edited for easy restoration and recovery to default settings. Of course, numeric values will depend as desired.
1. Edit this file '/modules/mod_search.php'
Delete this line:
$maxlength = $width > 20 ? $width : 20;
Add this line:
$maxlength = $width > 50 ? $width : 50;
2. Edit this file '/components/com_search/views/search/tmpl/default_form.php'
Delete this line:
<input id=”search_searchword” maxlength=”20″ name=”searchword” size=”30″ value=”<?php echo $this->escape($this->searchword); ?>” type=”text”>
Add this line:
<input id=”search_searchword” maxlength=”50″ name=”searchword” size=”30″ value=”<?php echo $this->escape($this->searchword); ?>” type=”text”>
3. Edit this file '/administrator/components/com_search/helpers/search.php'
Remove these lines:
// limit searchword to 20 characters
if ( JString::strlen( $searchword ) > 20 ) {
$searchword = JString::substr( $searchword, 0, 20 );
Add these lines:
// limit searchword to 50 characters
if ( JString::strlen( $searchword ) > 50 ) {
$searchword = JString::substr( $searchword, 0, 49 );
4. Edit this file '/language/en-GB/en-GB.com_search.ini'
Delete this line:
SEARCH_MESSAGE=Search term must be a minimum of 3 characters and a maximum of 20 characters.
Add this line:
SEARCH_MESSAGE=Search term must be a minimum of 3 characters and a maximum of 50 characters.
Remember to save all your files then reupload. Clear browser cache and refresh your Joomla website and your search character restriction should have increased to 50 characters.













In Joomla 1.5, this happens after I did the ff: