Change website title in Google

Home

I do not like the HTML code
in the Google entry for Calstock Trust:

CastockTrust.org.uk<br>Calstock Development Trust | Supporting The ...

This should be

CastockTrust.org.uk Calstock Development Trust | Supporting The ...

Using the info on drupal.org/node/37046 I have made a simple change to
xtemplate.engine
to replace any HTML tags with spaces:

change applied at 15:00 on Tuesday 20 December 2005
lets see how long it takes google to correct.......

for anyone who is interested the new code is as follows:

/**
 * modified December 2005 by mike@amcho.com to replace any HTML tags in the title by space
 * new function; Replace_Tags($text)
 */

function Replace_Tags($text) {
  $text=preg_replace('/</',' <',$text);
  $text=strip_tags($text);
  return $text;

}

/**
 * modified December 2005 by mike@amcho.com to
 * use new function; Replace_Tags($text) instead of strip tags
 */

function xtemplate_page($content) {
  global $xtemplate;

  // Construct page title
  if (drupal_get_title()) {
    $head_title = array(Replace_Tags(drupal_get_title()), Replace_Tags(variable_get('site_name', 'drupal')));
  }
  else {
    $head_title = array(Replace_Tags(variable_get('site_name', 'drupal')));
    if (variable_get('site_slogan', '')) {
      $head_title[] = variable_get('site_slogan', '');
    }
  }

Post new comment

*
*
The content of this field is kept private and will not be shown publicly.


*

  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • Web and e-mail addresses are automatically converted into links.