WordPress.org

Support

Support » Plugins and Hacks » Search Engine » Tip: Remove blog name from search-engine results

Tip: Remove blog name from search-engine results

  • The search-engine v0.5.7.1 plugin of course displays the title of each blog entry along with a summary of the content. If the index only contains one blog, it’s redundant and annoying to see the blog name in every title. For example:
    My trip by TravlerBlog
    Fun in a new town by TravlerBlog
    Packing tips by TravlerBlog

    To eliminate the ” by TravlerBlog” text (made up name for this example), I replaced line 1235 of search-engine.php with the following (line split for readability but this is all one line):

    <h3 class="search_engine_Title">
      <a href="<?php echo $result->url; ?>">
       <?php echo $search->search_do_excerpt(
      str_replace('&nbsp;by&nbsp;TravlerBlog', '',$result->title)
      ,68,false);
       ?>
      </a>
    </h3>

    The ‘str_replace()’ part replaces the original full $result->title.

    If there is a better way to do this, please post here. Thanks!

    HTH

Viewing 1 replies (of 1 total)
  • Plugin Author Scott Kingsley Clark

    @sc0ttkclark

    I’ve got a feature on my roadmap for the plugin for a filter on the page titles, so that it can remove the text “by TravlerBlog” from every title on indexing.

Viewing 1 replies (of 1 total)
  • The topic ‘Tip: Remove blog name from search-engine results’ is closed to new replies.
Skip to toolbar