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’ );
}
$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..
Hi Isak, I wasn’t knowing about this meta description and keyword header in drupal 7, thanks for the information. Keep going.
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.