Workaround for the duplicate Content-Type meta tag in Drupal

Category
drupal, seo
Date Created
4th Apr 2010
Last Updated
9th Jul 2010

Workaround for the duplicate Content-Type meta tag in Drupal

Question

How to stop duplicate Content-Type meta tag in Drupal?

Answer

<?
$head = str_replace('<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />', '', $head);
print $head
?>

Note the variable $head prints content-Type meta tag twice. Using the above code simply replaces the first occurance with nothing - i.e. removes it.

Related terms