Running into a strange issue with the XML sitemap on our site that I'm hoping for help with. Here is example code for the blog section of our site in our sitemap:

{% set blogPosts = craft.entries.find({ section: 'blogPosts'}) %}

{% for entry in blogPosts %}
        <loc>{{ filteredUrl(entry.url) }}</loc>
        <lastmod>{{ entry.dateUpdated.w3c() }}</lastmod>
        <changefreq>{{ changeFreq }}</changefreq>
{% endfor %}

For context, I believe that the sitemap template was built in roughly early December of last year as part of our site redesign. At the time we had yet to import a variety of older posts from our old website blog, but did so after the sitemap had been coded.

I'd like our sitemap to show those old posts created before the early December timeframe but, unless I change the "post date" to be after Dec 2014, the post will not appear. This is true even if I make a modification to the page, thus changing the dateUpdated field (which populates <lastmod>). If I change the post date of an old post to 2015, it will appear on the sitemap (with <lastmod> showing the current date), but if I change it back to 2014, it disappears.

There's no code that I can see in the template that sets a required post date timeframe for appearing on the sitemap.

What can I do to fix this issue?



Default limit is 100, try adding .limit(null) to the query


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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