2grosiek7 4 Posted October 21, 2013 Hi, Today I was upgraded the sitemap module in prestashop. I made new sitemaps and sent it to Google Webmaster Tools. And Google gave me an error about bad data format. Who can give me a solution to solve this problem? Regards! Share this post Link to post Share on other sites
vekia 8,950 Posted October 21, 2013 in file: gsitemap.php (located in module directory) you've got code like this one: private function _createIndexSitemap() { $sitemaps = Db::getInstance()->ExecuteS('SELECT `link` FROM `'._DB_PREFIX_.'gsitemap_sitemap` WHERE id_shop = '.$this->context->shop->id); if (!$sitemaps) return false; $xml = '<?xml version="1.0" encoding="UTF-8"?><sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"></sitemapindex>'; $xml_feed = new SimpleXMLElement($xml); foreach ($sitemaps as $link) { $sitemap = $xml_feed->addChild('sitemap'); $sitemap->addChild('loc', 'http://'.Tools::getShopDomain(false, true).__PS_BASE_URI__.$link['link']); $sitemap->addChild('lastmod', date('c')); } file_put_contents(dirname(__FILE__).'/../../'.$this->context->shop->id.'_index_sitemap.xml', $xml_feed->asXML()); } there is a line with: $sitemap->addChild('lastmod', date('c')); change date('c') to date ('Y-m-d') Share this post Link to post Share on other sites
vekia 8,950 Posted October 21, 2013 + change: if (!$this->_addLinkToSitemap($link_sitemap, array('type' => 'product', 'page' => 'product', 'lastmod' => $product->date_upd, 'link' => $url, 'image' => $image_product), $lang['iso_code'], $index, $i, $product_id['id_product'])) to if (!$this->_addLinkToSitemap($link_sitemap, array('type' => 'product', 'page' => 'product', 'lastmod' => date("d-m-Y", strtotime($product->date_upd)), 'link' => $url, 'image' => $image_product), $lang['iso_code'], $index, $i, $product_id['id_product'])) and all other too :/ Share this post Link to post Share on other sites
2grosiek7 4 Posted October 21, 2013 Still the same :/ Share this post Link to post Share on other sites
2grosiek7 4 Posted October 21, 2013 Date format should be in this format: Y-M-D, so, that's could be a problem Share this post Link to post Share on other sites
vekia 8,950 Posted October 21, 2013 private function _addSitemapNode($fd, $loc, $priority, $change_freq, $last_mod = NULL) { fwrite($fd, '<loc>'.(Configuration::get('PS_REWRITING_SETTINGS') ? '<![CDATA['.$loc.']]>' : $loc).'</loc>'."\r\n".'<priority>'."\r\n".number_format($priority, 1, '.', '').'</priority>'."\r\n".($last_mod ? '<lastmod>'.date("Y-m-d", strtotime($last_mod)).'</lastmod>' : '')."\r\n".'<changefreq>'.$change_freq.'</changefreq>'."\r\n"); } try with this Share this post Link to post Share on other sites
2grosiek7 4 Posted October 21, 2013 Wait, I found a wrong format in your code: if (!$this->_addLinkToSitemap($link_sitemap, array('type' => 'product', 'page' => 'product', 'lastmod' => date("d-m-Y", strtotime($product->date_upd)), 'link' => $url, 'image' => $image_product), $lang['iso_code'], $index, $i, $product_id['id_product'])) Look at date format, I am trying to generate new sitemap Share this post Link to post Share on other sites
vekia 8,950 Posted October 21, 2013 check Polish board, solution: private function _addSitemapNode($fd, $loc, $priority, $change_freq, $last_mod = NULL){ fwrite($fd, '<loc>'.(Configuration::get('PS_REWRITING_SETTINGS') ? '<![CDATA['.$loc.']]>' : $loc).'</loc>'."\r\n".'<priority>'."\r\n".number_format($priority, 1, '.', '').'</priority>'."\r\n".($last_mod ? '<lastmod>'.date("Y-m-d", strtotime($last_mod)).'</lastmod>' : '')."\r\n".'<changefreq>'.$change_freq.'</changefreq>'."\r\n"); } works. so conclusion: use this: http://www.prestashop.com/forums/topic/283362-new-sitemap-module-bad-data-format/?view=findpost&p=1426113 and this: http://www.prestashop.com/forums/topic/283362-new-sitemap-module-bad-data-format/?view=findpost&p=1426185 nothing more 2 Share this post Link to post Share on other sites
2grosiek7 4 Posted October 21, 2013 (edited) And it works fine! The date format should looks like Y-m-d, so everywhere, where we find 'c', we must changed it to 'Y-m-d' Write an article how to repair this bug on your site! Thank you! Edited October 21, 2013 by 2grosiek7 (see edit history) Share this post Link to post Share on other sites
vekia 8,950 Posted October 21, 2013 the wierdest thing is fact that it looks the same in earlier versions of google sitemap module :/ i think that google changed something Share this post Link to post Share on other sites
2grosiek7 4 Posted October 21, 2013 (edited) I checked my old sitemaps, and everywhere is format Y-m-d. Edited October 21, 2013 by 2grosiek7 (see edit history) Share this post Link to post Share on other sites
vekia 8,950 Posted October 21, 2013 lawl :| weirdy, i've got different code in 2.2.3 version anyway, we have got solution for this now and this is most important thing thank you for attention Share this post Link to post Share on other sites
2grosiek7 4 Posted October 21, 2013 (edited) Lol, the last 373 lines of second sitemap file has wrong date format. The first file looks good.What the hell?! Edited October 21, 2013 by 2grosiek7 (see edit history) Share this post Link to post Share on other sites
2grosiek7 4 Posted October 21, 2013 Yes, my module is generating two files, beacouse I have a lot od pages. And google tolerate just sitemap files up to 50kB, I think. Share this post Link to post Share on other sites
vekia 8,950 Posted October 21, 2013 even after regeneration ? try to remove files manually and then - regenerate sitemap Share this post Link to post Share on other sites
2grosiek7 4 Posted October 21, 2013 I tried to remove all sitemap files, generate new sitemaps and it is the same. Share this post Link to post Share on other sites
vekia 8,950 Posted October 21, 2013 but only for second file? Share this post Link to post Share on other sites
2grosiek7 4 Posted October 21, 2013 It's sounds like stupid joke, but - yes.Last 373 lines. Share this post Link to post Share on other sites
2grosiek7 4 Posted October 21, 2013 vekia, your solution from post #8 works fine! Thanks! Share this post Link to post Share on other sites
vekia 8,950 Posted October 21, 2013 can you send me url to this second file, i will inspect code, maybe it's related only for some other pages which i forgot to change Share this post Link to post Share on other sites
moraira 230 Posted October 21, 2013 WOW GREAT VEKIA, thanks for the info it runs now Share this post Link to post Share on other sites
2grosiek7 4 Posted October 21, 2013 vekia, your solution from post #8 works fine, I deleted that sitemaps, now is everything all right! Polish power, Polish engineers Share this post Link to post Share on other sites
vekia 8,950 Posted October 21, 2013 vekia, your solution from post #8 works fine, I deleted that sitemaps, now is everything all right! Polish power, Polish engineers haha ;D Now it's time to conquer Mars Share this post Link to post Share on other sites
FrenchMaster 30 Posted October 22, 2013 I still have errors in my sitemap. I made changes as #8 but it doesn't work for me... To be sure, can you post the complete gsitemap.php file ? Thank you Share this post Link to post Share on other sites
2grosiek7 4 Posted October 22, 2013 Catch an attached file gsitemap.php Share this post Link to post Share on other sites
FrenchMaster 30 Posted October 22, 2013 (edited) Thank you but still not working for me 1. I delete the sitemap files on server 2. I regenerated a new sitemap in Gsitemap module 3. I deleted sitemap in Google Webmastertool 4. I re-uploaded 1_index_sitemap.xml file in google same error... bad date format Edited October 22, 2013 by FrenchMaster (see edit history) Share this post Link to post Share on other sites
FrenchMaster 30 Posted October 22, 2013 OK. I think my problem is the same as described in russian forum. Sitemap doesn't work when importing products via CSV file. see here : http://www.prestashop.com/forums/topic/283332-prestashop-156-%D0%B8-%D0%BD%D0%BE%D0%B2%D1%8B%D0%B9-%D0%BC%D0%BE%D0%B4%D1%83%D0%BB%D1%8C-google-sitemap/?view=findpost&p=1425984 Can someone help me and translate in clear form what to do in english or french ? Thank you ! Share this post Link to post Share on other sites
vekia 8,950 Posted October 22, 2013 can you post url to your sitemap file? Share this post Link to post Share on other sites
FrenchMaster 30 Posted October 22, 2013 www.cadeaufou.com/1_index_sitemap.xml Share this post Link to post Share on other sites
vekia 8,950 Posted October 22, 2013 i checked your sitemaps it looks like everything is fine there, date is changed properly, also output from validation tool what you see in google? any error message? have you send sitemap once again? Share this post Link to post Share on other sites
keskifo 3 Posted October 24, 2013 (edited) Hello, Just did today's upgrade (V 2.3.1) and the error still exists... Google does not like the date format. I checked with two validators and the document is valid. OLD date format which worked: 2013-08-25T10:13:11+02:00 NEW date format which doesn't work: 2013-10-20 08:28:39 So who's right then? Edited October 24, 2013 by keskifo (see edit history) Share this post Link to post Share on other sites
vekia 8,950 Posted October 24, 2013 use date("Y-m-d") as it is mentioned before have you tried solution from frist page? Share this post Link to post Share on other sites
keskifo 3 Posted October 25, 2013 Tried the following way with date('c') and it worked: private function _addSitemapNode($fd, $loc, $priority, $change_freq, $last_mod = NULL) { fwrite($fd, '<loc>'.(Configuration::get('PS_REWRITING_SETTINGS') ? '<![CDATA['.$loc.']]>' : $loc).'</loc>'."\r\n".'<priority>'."\r\n".number_format($priority, 1, '.', '').'</priority>'."\r\n".($last_mod ? '<lastmod>'.date('c', strtotime($last_mod)).'</lastmod>' : '')."\r\n".'<changefreq>'.$change_freq.'</changefreq>'."\r\n"); } foreach ($sitemaps as $link) { $sitemap = $xml_feed->addChild('sitemap'); $sitemap->addChild('loc', 'http://'.Tools::getShopDomain(false, true).__PS_BASE_URI__.$link['link']); $sitemap->addChild('lastmod', date('c')); } file_put_contents(dirname(__FILE__).'/../../'.$this->context->shop->id.'_index_sitemap.xml', $xml_feed->asXML()); } gsitemap.php Share this post Link to post Share on other sites
FrenchMaster 30 Posted October 26, 2013 Thank you vekia for checking my sitemap. Unfortunately even if many checktools show that everything is OK, Google says error :-( wrong date format... Share this post Link to post Share on other sites
vekia 8,950 Posted October 26, 2013 and solution from post above? (try with attached file) Share this post Link to post Share on other sites
FrenchMaster 30 Posted October 26, 2013 I'll give a try... Share this post Link to post Share on other sites
FrenchMaster 30 Posted October 26, 2013 still the same... have a look www.cadeaufou.com/1_index_sitemap.xml Share this post Link to post Share on other sites
vekia 8,950 Posted October 26, 2013 really weird when you try to use this url in google account, you've got information about wrong file format? about <lastmod> field? i just wondering, maybe the problem in your case is somewhere else, not in <lastmod> field Share this post Link to post Share on other sites
fishordog 14 Posted October 27, 2013 (edited) have same issue as FrenchMaster, already tried all fixes posted in this thread. Still getting this error in webmaster tools: Sitemap:mydomain.com/store/1_en_0_sitemap.xml Parent tag: url Tag: lastmod Value: 2013-09-14 22:42:30 Does the solution from the Russian forum works? Edited October 27, 2013 by SeVi (see edit history) Share this post Link to post Share on other sites
fishordog 14 Posted October 27, 2013 Can someone look at this and tell if it will help. My date looks fine already as it is Y-m-d. So i guess the problem is with date of last modification. The solution by Kharkov_max from Russian forum is: Replace if (! $ this-> _addLinkTo Sitemap ($ link_ sitemap, array ('type' => 'product', 'page' => 'product', 'lastmod' => $ product-> date_upd, 'link' => $ url, 'image' => $ image_product), $ lang ['iso_code'], $ index, $ i, $ product_id ['id_product'])) with this if (! $ this-> _addLinkTo Sitemap ($ link_ sitemap, array ('type' => 'product', 'page' => 'product', 'lastmod' => date ('c', strtotime ($ product- > date_upd)), 'link' => $ url, 'image' => $ image_product), $ lang ['iso_code'], $ index, $ i, $ product_id ['id_product'])) After this change, the module will generate a sitemap. Xml correct date. These changes for the categories of suppliers and manufacturers. But! If you imported new products through CSV import and did not edited, the field from which to take the data to the module is NULL, ie date conversion to XML will give nonsense and google will swear to it. What would you need to treat it in a database MySQL: 1. Current Items from the date of renovation NULL assign a date product was added update prefix-table_product_shop set date_upd = date_add where date_upd = '0000-00-00 00:00:00 ' 2. Add a table prefix-table_product_shop and field date_upd trigger is hang on insert (appendix) DROP TRIGGER IF EXISTS `database`. `Update_date_product_insert`; DELIMITER $ $ CREATE TRIGGER `database`. `Update_date_product_insert` BEFORE insert ON `database`. `Prefix-table_product_shop` FOR EACH ROW BEGIN IF @ DISABLE_TRIGGERS IS NULL THEN set NEW.date_upd = NEW.date_add; END IF; END $ $ DELIMITER; Thus all the items have a date for the module triggered reporting date added when importing CSV, and edited by manual editing of the goods. PS. All of this has been tested and works, but before going live better test it on the test site 1 Share this post Link to post Share on other sites
FrenchMaster 30 Posted October 27, 2013 GOOD news in fact it works ! Yesterday I wrote there was the same error message after uoploading the new sitemap to google. It was showing the same errors. This morning, I checked at google and... errors desappear without doing or uploading anything. however I clicked several time on "refresh page" on google, I think the problem comes from google cache. so for those who still have problem : 1. delete your sitemap files in your root directory 2. download the attached file 3. replace the gsitemap.php file with the one you just downloaded 4. go in your BO / module / gsitemap and click on refresh. if necesserry click install several time 5. create your sitemap 6. go to google webmaster tools 7. delete your actual sitemap 8. click on refresh page 9. upload your new sitemap to google 7. check if errors still showing 8. wait a while (for me 24 hours) 9. go back to webmaster tolls 10. check again. now the errors must ae desappeared. gsitemap.php 2 Share this post Link to post Share on other sites
fishordog 14 Posted October 27, 2013 Good to hear it works. in #4 you mean reset module? Share this post Link to post Share on other sites
fishordog 14 Posted October 28, 2013 (edited) I did everything FrenchMaster said and now instead of 2500+ errors i get only 26: They look like this Sitemap:domain.com/store/1_en_0_sitemap.xml Parent tag: url Tag: lastmod Value: -001-11-30T00:00:00-05:00 Edited October 28, 2013 by SeVi (see edit history) Share this post Link to post Share on other sites
skibbi 1 Posted October 28, 2013 Has this plugin been resolved? Is there one post which has the all the code required for the fix, instead of piecing together multiple threads? Whats the chance this module will just be fixed so we don't have to waste our time with this type of issue? Seems everywhere I turn with this product (Prestashop) there is some sort of stupid issue happening.... -A rant is not a rant if it's true Share this post Link to post Share on other sites
bobiluse 4 Posted October 30, 2013 merci ca marche date invalid a disparue Share this post Link to post Share on other sites
ILMP 3 Posted October 30, 2013 GOOD news in fact it works ! Yesterday I wrote there was the same error message after uoploading the new sitemap to google. It was showing the same errors. This morning, I checked at google and... errors desappear without doing or uploading anything. however I clicked several time on "refresh page" on google, I think the problem comes from google cache. so for those who still have problem : 1. delete your sitemap files in your root directory 2. download the attached file 3. replace the gsitemap.php file with the one you just downloaded 4. go in your BO / module / gsitemap and click on refresh. if necesserry click install several time 5. create your sitemap 6. go to google webmaster tools 7. delete your actual sitemap 8. click on refresh page 9. upload your new sitemap to google 7. check if errors still showing 8. wait a while (for me 24 hours) 9. go back to webmaster tolls 10. check again. now the errors must ae desappeared. Bonjour FrenchMaster, Avant tout merci pour votre post Ultra Clair ... et ça marche ! Pour info (au cas ou pour vous et les autres utilisateurs) je rencontre des problèmes lors de la création Manuelle des différents sitemaps (Multiboutique) les liens comportants des erreurs. J'ai contourné le problème un créant une tache CRON par domaine. Je suis en PS 1.5.6 ------------- J'ai essayé de désinstaller le module V 2.3.1 pour revenir à l'avant dernière version mais visiblement il n'est pas possible ( avez-vous essayé? ) et petite dernière question, avec le version 2.2.11 du module il y a fait 3 fichiers (en tout) par domaine, avec la V V 2.3.1 je n'ai plus que 2 .. c'est aussi votre cas ? Merci à vous Matias Share this post Link to post Share on other sites
PiterKa 1 Posted October 30, 2013 private function _addSitemapNode($fd, $loc, $priority, $change_freq, $last_mod = NULL) { fwrite($fd, '<loc>'.(Configuration::get('PS_REWRITING_SETTINGS') ? '<![CDATA['.$loc.']]>' : $loc).'</loc>'."\r\n".'<priority>'."\r\n".number_format($priority, 1, '.', '').'</priority>'."\r\n".($last_mod ? '<lastmod>'.date("Y-m-d", strtotime($last_mod)).'</lastmod>' : '')."\r\n".'<changefreq>'.$change_freq.'</changefreq>'."\r\n"); } try with this I am sorry, but I don't get where should I place\replace this line ? Share this post Link to post Share on other sites
vekia 8,950 Posted October 30, 2013 I am sorry, but I don't get where should I place\replace this line ? it's a part of module .php file. btw. on github you can find solution: https://github.com/PrestaShop/PrestaShop-modules/tree/master/gsitemap Share this post Link to post Share on other sites
FrenchMaster 30 Posted October 31, 2013 I GET MAAAAAAD ! it doesn't work anymore for me : No problem with te date, and all my trials were OK with 100 products, but now I have 5000 products and I get a 404 page :-( I had no problems with the 5000 products with the 1.5.5.0 version... I increase max_execution time but it doesn't help. Any idea ? Share this post Link to post Share on other sites
fishordog 14 Posted November 3, 2013 (edited) the solution in posts before worked until i regenerated sitemap again in my store and now i have 1000+ errors like this: Sitemap:mydomain.com/1_en_0_sitemap.xml Parent tag: url Tag: lastmod Value: -001-11-30T00:00:00-05:00 Edited November 3, 2013 by SeVi (see edit history) Share this post Link to post Share on other sites
adigabrio 4 Posted November 3, 2013 (edited) I have o problem with this, please help me. Afişaţi 1 – 1 din 1 # Sitemap Tip Procesat Probleme Elemente Trimis Indexate 1 /1_ro_0_sitemap.xml Sitemap 3 nov. 2013 669 (de) erori web 676 1 Imagini 644 - Edited November 3, 2013 by adigabrio (see edit history) Share this post Link to post Share on other sites
adigabrio 4 Posted November 3, 2013 This you have o goog imagine Share this post Link to post Share on other sites
PiterKa 1 Posted November 3, 2013 Thank you @Vekia I did as advaiced, generated new file and uploaded to Google, it got accepted this time. Share this post Link to post Share on other sites
vekia 8,950 Posted November 4, 2013 hello it's weird that for some of us it works well and for others not Share this post Link to post Share on other sites
Rhobur 133 Posted November 4, 2013 It must be some sort of google cache issues. I tried this morning to generate a new xml to replace last week's one. Surprisingly I got the date error issue and gave up. I have restored the last week's xml but google keeps showing the same errors when testing the sitemap although it's been 3 hours now since I have replaced it with the old and good one. Share this post Link to post Share on other sites
PiterKa 1 Posted November 4, 2013 hello it's weird that for some of us it works well and for others not I am not sure if it helps, but I renamed the file name prior to uploading as google was reporting same errors if file name was unchanged. Share this post Link to post Share on other sites
vekia 8,950 Posted November 4, 2013 so it looks like problem with cache in google like Rho_bur said above, maybe this is main problem that files don't work after changes Share this post Link to post Share on other sites
fishordog 14 Posted November 6, 2013 so it looks like problem with cache in google like Rho_bur said above, maybe this is main problem that files don't work after changes Do you think google still gonna index those pages? Share this post Link to post Share on other sites
PiterKa 1 Posted November 6, 2013 Do you think google still gonna index those pages? Yes, but you need to change file name before you upload your file again to google. I received confirmation and 0 errors after uploading separate file with different file name. When you upload the file with same name as you uploaded previous file you will get same errors. Share this post Link to post Share on other sites
vekia 8,950 Posted November 6, 2013 so google contents of "old files" i think that after some time also "old files" will work fine Share this post Link to post Share on other sites
Roberto Zambelli 0 Posted November 6, 2013 from https://support.google.com/webmasters/answer/35738 ---------------------------- Invalid date Your Sitemap contains one or more invalid dates. This could be because a date is in the incorrect format, or the date itself is not valid. Dates must use W3C Datetime encoding, although you can omit the time portion if you wish. For example: 2005-02-21 2005-02-21T18:00:15+00:00Specifying time is optional (the time defaults to 00:00:00Z), but if you do specify a time, you must also specify a timezone. Make sure your dates match one of the following W3C Datetime formats. Then upload and resubmit your updated Sitemap. -------------------------- The actual version of gsitemap 2.3.1 has a wrong date record because is without the Time zone indication. However the old gsitemap.php (version 2.3) works very fine because the date is without the optional time zone specification. http://www.laterradellorso.it/1_index_sitemap.xml http://www.laterradellorso.it/1_it_0_sitemap.xml Thanks to 2grosiek7 who posted 22 october 2013 - #26 the download link of the old gsitemap.php 33.25KB to replace the newest one. I think that the gsitemap version 2.3.1 have to be corrected Roberto Zambelli Share this post Link to post Share on other sites
fishordog 14 Posted November 6, 2013 Yes, but you need to change file name before you upload your file again to google. I received confirmation and 0 errors after uploading separate file with different file name. When you upload the file with same name as you uploaded previous file you will get same errors. the default name when sitemap is generated is 1_index_sitemap.xml. Can i change it to any name? Will google let me submit it? I just don't want to mess something up Share this post Link to post Share on other sites
fishordog 14 Posted November 7, 2013 (edited) What if i upload master sitemap /1_index_sitemap.xml to webmaster tools instead of /1_index_sitemap.xml ? I just did it and i got more errors as before but the date looks like this : 3996 errors Parent tag: url Tag: lastmod Value: 2013-09-14 22:42:11 When i upload /1_index_sitemap.xml i get date error like this: 1119 errors Parent tag: url Tag: lastmod Value: -001-11-30T00:00:00-05:00 Not sure what to do, what the difference between those 2 urls? Edit: Uploaded same sitemap to bing and its fine, no errors. Edited November 7, 2013 by SeVi (see edit history) Share this post Link to post Share on other sites
fishordog 14 Posted November 7, 2013 bumping thread again. Does anyone knows what's the correct date format? I get errors: Parent tag: url Tag: lastmod Value: 2013-09-14 22:42:11 Share this post Link to post Share on other sites
ilan316 4 Posted November 8, 2013 same error, how to fix it? Share this post Link to post Share on other sites
asssets 0 Posted November 8, 2013 (edited) Im in US and here is my solution: Format for date should be: "Y-m-d\TH:i:sP" result: 2013-10-03T02:22:46-07:00 To have new sitemap resubmited right away I renamed file to 2_index_sitemap.xml and 2_en_0_sitemap.xml Open file 2_index_sitemap.xml and changed link to 2_en_0_sitemap.xml Submit new file to google. 2 minutes later files proccessed without errors. Edited November 8, 2013 by asssets (see edit history) Share this post Link to post Share on other sites
vekia 8,950 Posted November 8, 2013 Im in US and here is my solution: Format for date should be: "Y-m-d\TH:i:sP" result: 2013-10-03T02:22:46-07:00 To have new sitemap resubmited right away I renamed file to 2_index_sitemap.xml and 2_en_0_sitemap.xml Open file 2_index_sitemap.xml and changed link to 2_en_0_sitemap.xml Submit new file to google. 2 minutes later files proccessed without errors. how you changed dateformat to format that you said? Share this post Link to post Share on other sites
asssets 0 Posted November 8, 2013 (edited) I used code you provided on first page, but instead of Y-m-d i used Y-m-d\TH:i:sP Used Ctrl+F to search y-m-d and were replacing with Y-m-d\TH:i:sP I had 3 lines with date. Google sitemap Version :2.3.1 gsitemap.php Edited November 8, 2013 by asssets (see edit history) Share this post Link to post Share on other sites
Rhobur 133 Posted November 8, 2013 @assetsL I don't see any Y-m-d formatting in gsitemap (my version 2.2.11). The date is formatted by date© instruction. That should generate already 2004-02-12T15:19:21+00:00 as stated in the php manual. Still, for some reason it doesn't. I think that is where the issue resides. Share this post Link to post Share on other sites
asssets 0 Posted November 8, 2013 @ Rho_bur did you use code on first page? Read first page of this thread. Share this post Link to post Share on other sites
asssets 0 Posted November 8, 2013 I used code from posts #2,3,6 Share this post Link to post Share on other sites
Rhobur 133 Posted November 9, 2013 @assets: my bad, forgot to re read the first posts Sitemap working now with no errors in WMT! Share this post Link to post Share on other sites
ilan316 4 Posted November 9, 2013 I used code you provided on first page, but instead of Y-m-d i used Y-m-d\TH:i:sP Used Ctrl+F to search y-m-d and were replacing with Y-m-d\TH:i:sP I had 3 lines with date. Google sitemap Version :2.3.1 gsitemap.php still getting errors Share this post Link to post Share on other sites
fishordog 14 Posted November 9, 2013 (edited) I used code you provided on first page, but instead of Y-m-d i used Y-m-d\TH:i:sP Used Ctrl+F to search y-m-d and were replacing with Y-m-d\TH:i:sP I had 3 lines with date. Google sitemap Version :2.3.1 gsitemap.php I just tried this: -downloaded and replaced gsitemap.php(the date in the file already looked like this Y-m-d\TH:i:sP. Do i still need to change date somewhere?) -deleted old sitemap and generated new one -renamed both sitemaps -submited to wmt I have 4001 pages submited and i still get 1119 errors Parent tag: url Tag: lastmod Value: -0001-11-30T00:00:00-05:00 Not sure what else i can do. Gonna wait for 24 hours and see if errors will disapear but i doubt they will. Edited November 9, 2013 by SeVi (see edit history) Share this post Link to post Share on other sites
asssets 0 Posted November 9, 2013 Why there is "-" in front of date value? Share this post Link to post Share on other sites
fishordog 14 Posted November 9, 2013 (edited) Why there is "-" in front of date value? i have no idea. Just checked and some of the urls have date 2013-09-14T22:42:11-04:00 and some -0001-11-30T00:00:00-05:00. Doesn't make any sense why it would generate only some of it with correct date format. Edited November 9, 2013 by SeVi (see edit history) Share this post Link to post Share on other sites
ilan316 4 Posted November 10, 2013 are there any old version of the module? im getting the same problem with last version 2.3 Share this post Link to post Share on other sites
asssets 0 Posted November 10, 2013 i have no idea. Just checked and some of the urls have date 2013-09-14T22:42:11-04:00 and some -0001-11-30T00:00:00-05:00. Doesn't make any sense why it would generate only some of it with correct date format. Did you check data in database? Share this post Link to post Share on other sites
fishordog 14 Posted November 10, 2013 Did you check data in database? i checked same product that has bad date in sitemap. In database it has only date_add and date_upd and it looks fine 2013-09-28 03:40:31 2013-09-30 00:45:59 Where do i find last mod of the product in DB? Share this post Link to post Share on other sites
asssets 0 Posted November 11, 2013 As i understand date_upd is last modified date Share this post Link to post Share on other sites
vekia 8,950 Posted November 11, 2013 i checked same product that has bad date in sitemap. In database it has only date_add and date_upd and it looks fine2013-09-28 03:40:31 2013-09-30 00:45:59 Where do i find last mod of the product in DB? this field name is located in ps_product_Shop table and field name is: date_upd Share this post Link to post Share on other sites
fishordog 14 Posted November 12, 2013 As i understand date_upd is last modified date this field name is located in ps_product_Shop table and field name is: date_upd So if the date format in DB is correct 2013-09-30 00:45:59 , then the problem is with sitemap. Any suggestions ? Share this post Link to post Share on other sites
guanooo 9 Posted November 12, 2013 So, I also had this problem and read all of the comments in this topic. Give it a try. WT now accepts the file with no errors. But if you check the date format in the file before sending it in WT it won't be the date you've created the file. I suppose that with this file now it just ignores the date: 1. Download the attached file - gsitemap.php. 2. Delete previous sitemaps on your server. 3. Deactivate the module in BO. 4. Activate the module again. 5. Generate the sitemap(s). 6. Rename the generated file (2 files if you have multiple languages). 7. Upload the file in WT 8. Check for errors now. Any success? 1 Share this post Link to post Share on other sites
fishordog 14 Posted November 12, 2013 (edited) i just submitted new sitemap, so it's still pending. Will post when it's done Update: still getting errors, before it was 1119, now 1056. An invalid date was found. Please fix the date or formatting before resubmitting. Parent tag: url Tag: lastmod Value: 1969-12-31 Edited November 12, 2013 by SeVi (see edit history) Share this post Link to post Share on other sites
fishordog 14 Posted November 13, 2013 (edited) i just searched my DB for products that have bad date format in the sitemap. The ones with bad date have different values from "normal" products. fields: redirect_type is empty(other products have 404) indexed = 0 date_add looks fine, but date_upd is 0000-00-00 00:00:00 Weird thing. When i open the product with empty fields in BO and click on save, without editing anything it changes values in the database. So what will be the quickest way to fix this? It will take long time to open and save them one by one. Update: I have added not indexed products to index in Preferences>Search>Add missing products to the index. it fixed the indexed field, but not redirect_type and date_upd Update 2 I dont get it, just ran sql query to replace all 00-00-00 date_upd values to todays date. It replaced everything just fine but in sitemap those products are shown with <lastmod>1969-12-31</lastmod> Edited November 13, 2013 by SeVi (see edit history) Share this post Link to post Share on other sites
avionicom 3 Posted December 14, 2013 So, I also had this problem and read all of the comments in this topic. Give it a try. WT now accepts the file with no errors. But if you check the date format in the file before sending it in WT it won't be the date you've created the file. I suppose that with this file now it just ignores the date: 1. Download the attached file - gsitemap.php. 2. Delete previous sitemaps on your server. 3. Deactivate the module in BO. 4. Activate the module again. 5. Generate the sitemap(s). 6. Rename the generated file (2 files if you have multiple languages). 7. Upload the file in WT 8. Check for errors now. Any success? After application of your suggestions, it now works. Thank you! 1 Share this post Link to post Share on other sites
Flmbx 5 Posted February 16, 2014 Picking into this... Anyone having a Google Sitemap version for download compatible with PS version 1.4.9? By default I had gsitemap v1.9 in my shop but it also suffered the dateformat error. Version 2.3.2 isn't compatible with PS 1.4.9. Share this post Link to post Share on other sites
fishordog 14 Posted March 1, 2014 Picking into this... Anyone having a Google Sitemap version for download compatible with PS version 1.4.9? By default I had gsitemap v1.9 in my shop but it also suffered the dateformat error. Version 2.3.2 isn't compatible with PS 1.4.9. You can download older presta versions here http://www.prestashop.com/en/developers-versions and just use module from there Share this post Link to post Share on other sites
patsoto 0 Posted March 3, 2014 (edited) hi i read all the post but nothing work for me i import all the products and the categorias from a csv please help me Edited March 3, 2014 by patsoto (see edit history) Share this post Link to post Share on other sites
fishordog 14 Posted April 19, 2014 (edited) hi i read all the post but nothing work for me i import all the products and the categorias from a csv please help me it has been almost a year and every new version of the module has no fix for this.... Edited April 19, 2014 by fishordog (see edit history) Share this post Link to post Share on other sites
fishordog 14 Posted June 15, 2014 (edited) http://www.prestashop.com/forums/topic/336382-solvedroll-back-sitemap-generator-module-update/ In this thread El patron has attached sitemap module from version 1.5.4.1. It fixed lastmod errors in my 1.5.6.2 shop Edited June 15, 2014 by fishordog (see edit history) Share this post Link to post Share on other sites
yourtoolcrib 0 Posted July 9, 2015 I don't know where in the file to add code in the answer #8 in. Can you please explain. Share this post Link to post Share on other sites