how important is the "<lastmod>" in sitemap.xml? some sitemap generators include this in their generated sitemaps, some don't have it... is it okay if there's no lastmod in my sitemap.xml?
It's an optional value. So you can, but you don't have to use it. I personally use it, but set it to the time when I create the sitemap file. I don't think that this is good or perfect, but Google visits my website regularly and I don't believe that I get penalized for doing it that way. (But I also set the change frequency to always.) If you don't add it you can't do anything wrong. Best regards, Tobias
Though Google has stated it as an optional field, it makes sense to include it if you can. If your site has static pages, sitemap creators like GSiteCrawler can automatically popluate the lastmod field from the server response headers. However, if your site has dynamic pages (forums/blogs), it can be difficult to include the actual lastmod date. The best option then would be to leave the field blank than populate all urls with current date (at the time of creating sitemap). GSiteCrawler also recognizes meta date tags which you can include in your dynamic pages, if possible.
I have been playing around the google sitemaps for a while, and I find that it is best to use lastmod if possible and with as much accuracy as possible. If you update a page, update your sitemap file when you are done. If you are using a custom content management system driven by a database, then it is even easier. I suggest at the very least: location, lastmod, priority. Oh, and never lie to Google. It's not hard for them to work out who lies to them. If you haven't updated the page, then don't say you have. They may not penalize you now, but they are always changing the rules, and you don't want to be caught out.
I am biased, but I think priority, lastmod and update frequency should be set as precise as possible. It is possible to get some decent results for these using a site map generator. Check e.g. www.micro-sys.dk/sitemap.xml LastMod is problematic for dynamic pages though (you can see I only have LastMod specified for .HTML pages) since the server as default does not send a "last modified" header. If you wish, you might be able to add some code like this: <?php header("Last-Modified: " . gmdate("D, d M Y H:i:s", filemtime($SCRIPT_FILENAME)) . " GMT"); ?>
I do have some exp with that. Just a week ago, I found that Google has not been indexing my page since the last time I edited it. So I change the <Lastmod> section in the Sitemap. and just 2days later, when I search my domain in Google, I found Google indexed the new version of that page.