I wan to change the HTML page title: It is displayed as "pagename | sitename"; I want to change it to "sitename - pagename."

How can I do this?

3 Answers 3

<?php $Title = explode('|',$head_title);
echo $Title[1]." - ".$Title[0];

Add this in the html.tp.php file, inside the <title> tag.


I would have used existing $head_title_array variable like this:

<title><?php print $head_title_array['name'] . ' - ' . $head_title_array['title']; ?></title>

Reference: html.tpl.php

You can also do this with the Metatag module.


You can use Page Title module. After installing it, you can access the configuration page of the module by navigating to:

  • Drupal 6: Administer › Site configuration › Page title
  • Drupal 7: Administration › Configuration › Search and metadata

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.