ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Sitemap lists old dates for recent entries

March 10, 2009 7:22pm

Subscribe [3]
  • #1 / Mar 10, 2009 7:22pm

    Tammo

    59 posts

    Hi,

    I noted that my sitemap shows old dates (1999-11-29T23:00:00+00:00) for recently added entries, but I also see correct dates in there. see example:

    - <url>
      <loc>http://www.hospitality-industry.com/index.php/news/comments/8543/</loc> 
    - <news:news>
      <news:publication_date>1999-11-29T23:00:00+00:00</news:publication_date> 
      <news:keywords>Food and Beverage, Business, Hospitality, Hotels, Hotel, Travel</news:keywords> 
      </news:news>
      </url>

    or the sitemap

    I only discovered this issue after having some issues with my PHP upgrade to 5 that my news articles where not indexed anymore by Google News and I looked at my sitemap.

    Any idea where those dates are coming from? I defenitly wasn’t putting those entries in back in 1999 😊

    Thanks,
    Tammo

  • #2 / Mar 10, 2009 9:27pm

    Greg Aker

    6022 posts

    what date does it show for those entries in the edit tab, and how are your constructing the site map?

  • #3 / Mar 11, 2009 2:49am

    Tammo

    59 posts

    Hi Greg,

    The date in the edit tab is from 2009 (for the example it is 03/10/09 09:12 pm). The sitemap is generated by a template, see code below:

    <?xml version="1.0" encoding="UTF-8"?>
    {assign_variable:my_weblog="default_site"}
    {assign_variable:my_template_group="site"}
    <urlset >
    {exp:weblog:entries weblog="news" limit="1000" disable="categories|custom_fields|member_data|pagination|trackbacks" rdf="off" dynamic="off" status="Open"}
        <url>
            <loc>{permalink="news/comments"}</loc>
            <news:news>
             <news:publication_date>{gmt_edit_date format='%Y-%m-%dT%H:%i:%s%Q'}</news:publication_date>
            <news:keywords>Food and Beverage, Business, Hospitality, Hotels, Hotel, Travel</news:keywords>
            </news:news>
            </url>
            
    {/exp:weblog:entries}
    </urlset>

    I noticed that when I ammend the entry and save it, the date changes to the correct date. So it it seems that some new entries get the old date but when updated that date changes into the current date. I create new entries manually and with moblog.

    Thanks,
    Tammo

  • #4 / Mar 11, 2009 3:20am

    John Henry Donovan

    12339 posts

    Tammo,

    If you try the following for the date_publication, does that change things?

    {gmt_date format="%Y %m %d"}

    EE Docs : gmt_entry_date

    I am guessing the entries that have never been edited are showing the wrong date?

  • #5 / Mar 11, 2009 9:03am

    Tammo

    59 posts

    Hi John, spot on! this solved the issue. Thanks a lot!

    regards,
    Tammo

  • #6 / Mar 11, 2009 12:12pm

    Sue Crocker

    26054 posts

    Glad you were able to find out what the problem was. Don’t hesitate to post again if needed.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases