You are here:  » Adding meta tag for Google Sitemap


Adding meta tag for Google Sitemap

Submitted by srl2112 on Thu, 2006-04-27 19:01 in

I registered my site with Google Sitemaps. They now need a meta tag added to the site to activate.

Looking for a place to put this.

Thanks so much,

Steve

Submitted by support on Thu, 2006-04-27 19:15

Hi Steve,

Thanks for bringing this up. Previously, verification required that you upload an HTML file something like 1234567890ABCD.html to your site - is that option no longer available?

Meta tags can be included on any Price Tapestry page by loading an array called $header["meta"] prior to including html/header.php. If the Google Sitemaps verification process requires the meta tag on your site's home page (index.php), then add the following code to the top of index.php

<?php
  $header
["meta"]["verify-v1"] = "string_google_ask_for";
?>

I've just looked at the instructions on the Google Sitemaps help pages, and it asks you to "copy and paste" the code it provides into your site, so there is a chance that it may have to be precise and so the above method might not work. If this is the case, you would need to paste the code into html/header.php, immediately before the following line:

</head>

This will include the sitemaps meta tag on all pages, however you should be able to remove it once the site has been verified.

Cheers,
David.

Submitted by srl2112 on Thu, 2006-04-27 20:34

Thanks David,

It looks like they do give you an option of uploading an html page as another option. I'll just stick with your instructions for the index.php route.

So far, when I pasted the code :

<?php
  $header
["meta"]["verify-v1"] = "string_google_ask_for";
?>

at the top of my index.php file, I get the following on the top of my home page.

Warning: Cannot modify header information - headers already sent by (output started at /home/content/p/r/i/pricescan/html/index.php:5) in /home/content/p/r/i/pricescan/html/html/header.php on line 6

Any idea what I did wrong?

Thanks ...Steve

Submitted by support on Fri, 2006-04-28 01:32

Hi Steve,

I just realised that may happen if you pasted the code including the php tags at the top of index.php. Try just adding the code on its own at the top (but after the opening PHP tag):

  $header["meta"]["verify-v1"] = "string_google_ask_for";

In other words, you would have:

<?php
  $header
["meta"]["verify-v1"] = "string_google_ask_for";
  .... 
rest of code ....
?>

It should then work as expected.