Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to know how to set description and meta keywords for the front page. I use the Meta tags module for articles, but it is not working for the front page.

I use Panel as my front page.

My website is http://www.techiestuffs.com, and runs on Drupal 7.

if you see the HTML source of the front page, it only contains the following HTML:

<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link rel="shortcut icon" href="http://www.techiestuffs.com/sites/default/files/favicon.png" type="image/png"/>
<meta name="Generator" content="Drupal 7 (http://drupal.org)"/>
<title>TechieStuffs | Stuffs for Geeks</title>

I had tried adding these functions in template.php:

function yourtheme_page_alter($page) {
  $meta_description = array(
    '#type' => 'html_tag',
    '#tag' => 'meta',
    '#attributes' => array(
    'name' => 'description',
    'content' =>  'Description about the site'

  $meta_keywords = array(
    '#type' => 'html_tag',
    '#tag' => 'meta',
    '#attributes' => array(
    'name' => 'keywords',
    'content' =>  'Some Keywords about the site'

  drupal_add_html_head($meta_description, 'meta_description');
  drupal_add_html_head($meta_keywords, 'meta_keywords');

But this function does not seems to work as you can see in my websites source code.

Does anyone know how to work out this?

share|improve this question
I checked meta tag module, you can set default for front page... – Mohammad Ali Akbari Apr 28 '12 at 6:32
Welcome to Drupal Answer, if the answer is helpful for you consider selecting it as the correct answer. There is a checkmark below the answer ratings. ▲ ▼ √ – niksmac May 6 '13 at 4:45
If you are using Panels for your home page and the MetaTag module drupal.org/project/metatag you need to make sure that in addition to enabling the basic MetaTag module, you also enable MetaTag: Panel submodule. This will allow you to set metadata for panel pages. – kbrinner Mar 13 '14 at 21:38

In drupal 6 I used Nodewords which allowed you to set meta tags on the front page as a configuration. In D7 this has been replaced by Meta Tags which may do the same thing or you.

share|improve this answer
But My front page is a panel so the front page ovberride doesn't work and i also tried to assign meta tags for panels but it is also not showing up. – vivi Dec 26 '11 at 8:45
Does it work for a simple front page? It being a panel shouldn't matter I would have thought. – Malks Dec 29 '11 at 2:21

Add them in your theme file; whichever theme you're using, it should have an HTML skeleton that you can change.

share|improve this answer
I used this code in template.php – vivi Dec 24 '11 at 9:36
drupal_add_html_head( $meta_description, 'meta_description' ); drupal_add_html_head( $meta_keywords, 'meta_keywords' ); – vivi Dec 24 '11 at 9:37
but still meta not showing up – vivi Dec 24 '11 at 9:37
add it statically in .tpl file of theme where you have head tag. check you theme folder and front.tpl file. – Code Lღver Dec 24 '11 at 9:39
is your meta description is dynamic ? – Code Lღver Dec 24 '11 at 9:40

Unfortunately, Views or Panels do not have meta tags by default. If you use either one for your frontpage, you can use the Meta Tags Quick Module, which allows the addition of the main meta tags for any path that is generated by Drupal.

share|improve this answer

I'm using Path-Based Metatags option in Meta tags quick module, enable module and go to front page, you will see Path-Based Metatags option...when you click on the option, you can fill in the fields that you want, you can also set the fields that you want to display (admin/config/search/metatags_quick)...

share|improve this answer

I see this is an old thread, but in case people find and still looking for an easy solution. I didn't like the Drupal way or Meta Quick. Found this super easy module, Simple Meta, adds a tab at left side directly on every page. I edit only description and meta tag instantly appeared. https://drupal.org/project/simplemeta.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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