Tips for creating and fixing time-date format issue on google sitemap.xml

Salam Alikum and Peace  be upon you…
          Sitemap.xml is that simple XML data file that has the mostly the entire site links you liked search engines like google to crawler and keeps it so it would appear on searching and indexing your site.

While I was creating and developing my own dynamic blogging system ‘she7ata’s-blogs‘, I liked really to create the sitemap.xml dynamically, and that’s how I faced some issues like the time/date format and other issues.
I thought it was really an easy task, but I’ve spend couple of hours fixing things and returning back to sitemap protocol to know what is the problem

Here is a simple and quick tips for you to quickly generating a sitemap.xml file.
First, here is a simple xml file sample, maybe you can copy and past for quick start.
weekly 0.8

First, …


first of all, I’ve encountered that problem, and I did not know what’s wrong, but after along time of testing, I discovered that if you left one line before the xml definition or header, your browser will never recognize or display your sitemap.xml file formatted as it should be, the same for RSS and ATOM xml feeds!.

Remember, that every URL has 4 basic elements, Loc or Location, last-modified date, change frequency and priority .
Priorities is very and till now I did not see it has a effect on anything, but you should have a value from 0 to 1.
Location is the location of the document or the file you’re indexing.
And finally the date-format should be on specific scheme like

Please note that you will need to do some checking before generating date, because google will not accept a date like 2009-10-5T…. it should be 2009-10-05T…. that means you will check the length of the string representing the day and month and add one more Zero on the left hand side incase the length is one (one digit)

Please notice the google sitemap.xml invalid date error screenshot below. is not equal to for google !


Google would stop processing your posted sitemap.xml file if they notice that you’re using a external link, even if you tried to post a link from within the same domain but with or without the www, google will give you alert, you should use EXACTLY the same domain you have used on your ‘google webmaster tools‘ account.

Sitemap resources.

  • For those people who liked to unde