Latest News

How to Install Custom Meta Tags in Drupal Home Page

Monday, September 28, 2009 , Posted by m4solutions at 7:46 PM

I came across this issue in Drupal when I wanted to insert the custom meta tag that Google requires you put on your site before pointing them to your sitemap.xml. The Meta Tag module only allows you to put in keywords and descriptions, so you need to improvise by getting into one of the php files of Drupal.

Here are the instructions for putting custom meta tags on your Drupal home page.

1. Go into your themes folder.
2. Open the theme folder that you currently have installed on your site.
3. Now open the pagetpl.php file with your text editor.
4. in the section place the following code.
(?php if ($is_front) : ?)
( meta name="google-site-verification" content="Or Whatever Meta Tag You want" /)
(?php endif; ?)

5. Make sure to change the opening and closing () to <> for each line.

That's it, Save your document and you can view the source of the page in a browser and see your changes.

Note: Always make a backup of your php files before modifying them.

Currently have 0 comments:

Leave a Reply

Post a Comment