1

I am trying to add a Google Site Map for my site but am having a few issues. I get the following errors from Google (see attached).

enter image description here

I guess it is to do with:

{gmt_edit_date format="%Y-%m-%d;T;%H:%i:%s%Q"}

but I am not an expert. I was just following a screen cast. Any help would be appreciated.

3 Answers 3

1

{edit_date format="{DATE_W3C}"}

1
  • Many thanks ... I will try and let you know. Apr 12, 2013 at 22:05
0

I've used the following format in Google sitemaps without any issues:

{gmt_edit_date format='{DATE_W3C}'}
2
  • Many thanks ... I will try and let you know. Apr 12, 2013 at 22:25
  • How is the variable generated? Apr 13, 2013 at 14:51
0

You've just got a couple of superfluous semi-colons in around the T. Change:

{gmt_edit_date format="%Y-%m-%d;T;%H:%i:%s%Q"}

to:

{gmt_edit_date format="%Y-%m-%dT%H:%i:%s%Q"}

Google should accept that but you'll need to give it time to re-spider your pages again. Give it 24-48 hours and you should see things resolved back in Webmaster tools.

To provide a longer explanation for anyone who's interested; Google expects the date to be in a W3C valid date/time format. Both of these are acceptable:

2005-02-21

2005-02-21T18:00:15+00:00

But if you specify the time then you must also specify the timezone. In this case you're doing so with GMT so that's fine.

As mentioned, you can also use:

{gmt_edit_date format='{DATE_W3C}'}

Which is actually just a shortcut for the corrected code provided above. It will output the exact same thing.

4
  • Many thanks ... I will try and let you know. Apr 12, 2013 at 22:28
  • this worked a treat. The code in the screen cast I used worked in the the screen cast if you get me which is odd ... Also he says that Google does not like site maps outside the root directory ... and discuses using some PHP to rename the site map file and place it in the root ... Is this still the case as I don't seem to be having any issues missing out these steps ... Also thanks for the additional info. Apr 13, 2013 at 14:50
  • It's common practice to place the sitemap in the root directory of your site as it sets the schema for the entire site. You could place it inside of a directory but then you could only index things in that directory and not up one level back to root. It's explained here without character limitation. :) You shouldn't need any PHP. The easiest thing is to use a tool to generate sitemap.xml for you and then you just need to drop it in the site root.
    – Ian Young
    Apr 13, 2013 at 19:09
  • Don't forget to mark the answer as accepted if it's helped solve the issue.
    – Ian Young
    Apr 13, 2013 at 19:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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