Drupal search results - remove author

Drupal 7 search also outpust the author and time of posting but quite often you don't need or want this information printed out.

So, how do you remove the author and date of posting?

  1. Using your favorite FTP program go to 'modules/search' folder and copy 'search-result.tpl.php' file into your 'sites/all/themes/yourthemename' folder (and sometimes there is a 'templates' folder in which case you should copy this file here).
  2. Open 'search-result.tpl.php' file in your favorite text editor
  3. Search for the string:
    <?php if ($info) : ?>
    <p class="search-info"><?php print $info; ?></p>
    <?php endif; ?>
  4. Comment it out like this:
    <?php /*?><?php if ($info) : ?>
    <p class="search-info"><?php print $info; ?></p>
    <?php endif; ?><?php */?>
  5. Clear the cache by going to:
    yourdrupalinstallation/admin/config/development/performance and press the 'Clear all caches' button
  6. Try searcing for a term or text and here you go. Author and time of publishing should be gone.

Izdelava spletnih strani ganesa.si

Izdelava spletnih strani ganesa.si