Under Admin > Site Configuration > Site Information > Name is where the title of the website goes in the Meta.

A trailing pipe: | is added to the end of the title by Drupal. For example: Name: My Site Title | Does anyone please know how to remove that?

Thanks in advance.

Comments

watcha’s picture

What theme are you using? / have you changed page.ptl.php?

waynedrupal’s picture

Okay, I see what I did. I had page titles module installed. Just needed to set that properly for the home page. And also the site name.

Here is what I put:

First Keyword | Second Keyword | Third Keyword | [site-name]

Thanks for your time.

K.J.’s picture

I had this same issue, using the Acquia Slate theme. I never did figure out what was causing it.

My solution was kind of hacky. I replaced $head_title with preg_replace("/ \| $/", "",$head_title) which uses a regex to remove the trailing slash.

hkirsman’s picture

print trim($head_title, ' |'); seems leaner. It also removes spaces from the end and start if there are any.

tecjam’s picture

I think the best way to do this is by using the hook_html_preprocess function in your themes template.php file.

eg:

/**
* Preprocesses the wrapping HTML.
*
* @param array &$vars
*   Template variables.
*/
function YOUTHEME_preprocess_html(&$vars) {
  $vars['head_title'] = str_replace("|", " · ", $vars['head_title']);
}

Replace · with whatever you wish to use instead of the pipe.