Hi,

I'd like to have meta description tags which will consists from a static text + the page title. The static text will change per content type.

Given that there is no nodewords/metatags module for Drupal 7, what other solutions exists?

Are there other modules that could do the job?
Is there some way to do this with theming?

Thanks

Comments

peterherman’s picture

Same Problem,

I'm looking for since 5 January for a solution.
Without a Solution for Meta-Tags and Meta description is Drupal7 worthless for me.

Brian Tastic’s picture

I confounds me why something so central to websites is not part of Drupal core.

The Nodewords module (which I currently use in my D6 site), as you know, is not ready for D7, from what I gather, there has been a major rewrite of the code base. I get the impression that this code base is quite unwieldy, though I don't speak as someone that has looked at the code, so it's just my gut feeling from various posts I've read.

I'm considering creating a simple module for myself. As I understand it, it's fairly straightforward to have a module add something to the tags.

Kirk’s picture

If you know a little PHP you can pretty easily do as you describe with a custom module or even a preprocess function at the theme level. This is probably a decent place to start http://drupal.org/node/223430

Nodewords, while helpful, is a whole other problem because it allows for you to generate meta tags in a variety of ways. It doesn't surprise me that it isn't out yet. But if all you want is "Static Text | Node Title" you can easily do that on your own.

bensnyder’s picture

You could do something like this which is quick and simple until Meta Tags is released....

html.tpl.php

<head profile="<?php print $grddl_profile; ?>">
  <?php print $head; ?>
  <title><?php print $head_title; ?></title>
  <?php manualMetaTags($_GET['q']); ?>
  <?php print $styles; ?>
  <?php print $scripts; ?>
</head>

template.php

<?php

/**
 * Temporary substitute for Meta Tags module.
 *
 * @param $path
 *   The path of the page, passed from html.tpl.php
 */
function manualMetaTags($path) {
  // determine the path of the page
  switch ($path) {
      
    case 'front':
        $description = "Description for the front page";
        $keywords    = "Here are some, keywords, for the, front page of, the site";
        break;
    
    case 'about':
        $description = "Description of the about page.";
        $keywords    = "yadda, yadda, yadda";
        break;
    
    case 'about/profiles':
        $description = "Description of the Profiles subpage.";
        $keywords    = "yadda, yadda, yadda";
        break;
    
    default:
       // if all else fails...
       $description = "Default.";
       $keywords    = "default";
  }
  
  // output
  print "<meta name='description' content='".$description."' />\n";
  print "<meta name='keywords' content='".$keywords."' />\n";
  
}

?>

....just a suggestion

Anonymous’s picture

I'm happy with this solution!

I was wondering, is there a way to set a catch all value for nodes which could be taxonomy terms?

Just thinking about duplicate descriptions and SEO.

S

joe casey’s picture

You can use drupal_add_html_head() to set meta tags. Likewise, drupal_set_title() can be used to set the title.

valthebald’s picture

That's exactly how metatags_quick works.
It defines new field type 'meta', which uses drupal_add_html_head() instead of standard rendering.

jnctn_ramon’s picture

This is a simple SEO module I created. It applies general meta tags and descriptions to your drupal7 site.

**UPDATE**

sorry, company laid me off and this is my personal account so i removed the link. i'll work on putting up a new module :)

ToneUK’s picture

I have created a module that automatically generates Meta tag descriptions from the node summary or body fields. The module allows you to select what content types to auto generate the Meta tag descriptions for and also allows you to specify a Meta tag description and Meta tag keywords for the home page. http://drupal.org/sandbox/ToneUK/1187576

mrmeech’s picture

For anyone stumbling across this thread in need of an answer, this now exists: http://drupal.org/project/metatag

Anly Dcouth’s picture

Hi,
I need to provide no indexing for a particular content via the meta tags module but i don't find any option for that in the configuration page of meta tags. Am i missing something?? or do i need to put in some other module.
Thanks in Advance

benchesters’s picture

I have been tearing my hair out now for about 2 hours, I cannot get this module to ouput the meta tags I write, it just keeps using default ones. I have tried disabling them, enabling them, creating a default for my content type. Still the same, it's driving me mad! Can anyone please let me know what I am doing wrong here? When I save the content, i go back in and the field is blank or just contains the default token - never the content I just wrote in it?

Why meta tags are not part of core I really cannot understand!

seandm’s picture

Yah the module meta tags is not working.

lomo’s picture

Yeah, I wish meta tags were a part of core, too. In any case, till the meta tags module is fully working you might want to try the Metatags quick module, at least for basic interim needs.

See you at the Drupalcon!