How to add Meta Description and Keywords to Header in Drupal 7

If you want to add meta description and meta keywords in your site then go to your site default theme folder’s template.php file and paste the code (display below) :function yourtheme_page_alter($page) {
$meta_description = array(
‘#type’ => ‘html_tag’,
‘#tag’ => ‘meta’,
‘#attributes’ => array(
‘name’ => ‘description’,
‘content’ => ‘some description here’
));
$meta_keywords = array(
‘#type’ => ‘html_tag’,
‘#tag’ => ‘meta’,
‘#attributes’ => array(
‘name’ => ‘keywords’,
‘content’ => ‘some, keywords’
));
drupal_add_html_head( $meta_description, ‘meta_description’ );
drupal_add_html_head( $meta_keywords, ‘meta_keywords’ );
}

Thank You..

By Isak

I am Isak, founder of onlineguider.com. I love reading, writing, and sharing my skills and knowledge to all over the world using a modern digital platforms.

Related Post

2 thoughts on “How to add Meta Description and Keywords to Header in Drupal 7”
  1. Hi Isak, I wasn’t knowing about this meta description and keyword header in drupal 7, thanks for the information. Keep going.

  2. Hello sir, your blog is very nice and informative and, thank you for sharing this blog about adding meta description and keywords in Drupal 7. This blog is seriously being very helpful sir. Thanks again.

Leave a Reply

Your email address will not be published. Required fields are marked *