-2

I'm using Drupal 7 and want to add meta tags in my theme. How can i do it without any module?

closed as too broad by Triskelion, monymirza, AjitS, Free Radical, Chapabu Jul 24 '13 at 13:24

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    D7 doesn't come with any meta-tag functionality out of the box. You have to use a module. – Beebee Apr 15 '13 at 9:14
  • Why getting (-) votes for this question? Funny boys... Thank you @Beebee – Karmacoma Apr 15 '13 at 11:11
  • 2
    @Karmacoma Voting is usually based on the quality/relevancy of a question. The downvotes have likely been attracted as you haven't shown any research effort yourself, and because it's a very broad question. You also haven't explained why you won't use a module. Modules are the native way to extend Drupal's functionality; if you don't want to use them, you can't extend the functionality (well, you might be able to do some things at the theme layer but that's by-the-by) – Clive Apr 15 '13 at 11:21
2

Using a module is the preferred way, as in that way you don't need to edit a theme, or create a sub-theme to set meta tags.
The alternative would be changing the html.tpl.php template used from the theme, and add a call to a function present in its template.php file that returns the meta tags to add to the page.

There is one case where editing the theme being used, or sub-theming it, to add the meta tags would make sense: when the meta tags are very specific for the theme being used that they should not added to every theme used from the site.

I would also prefer using a module as I would not need to worry about updating the module for a new Drupal version, or writing the update functions.
If, viceversa, I need to be 100% sure there will be a module version for the next Drupal, I would write my own custom module, knowing that it's just me that can fix any security issues I would introduce in the code (which also mean I am left alone with finding any security issue).

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