Skip to content

Commit

Permalink
Merge pull request #171 from WithCandour/jc/fix/remove-future-entries…
Browse files Browse the repository at this point in the history
…-sitemap

Excluding future entries from the sitemap
  • Loading branch information
CandourDevs authored Sep 2, 2024
2 parents 7dd33f4 + f1c41d7 commit e959f2d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/Sitemaps/Sitemap.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ public function getSitemapItems()
->where('collection', $this->handle)
->where('site', Site::current()->handle())
->where('redirect', '=', null)
->where('date', '<=', now()) // Exclude future posts by checking the post date is less than or equal to today
->get();
break;
case 'taxonomy':
Expand Down

0 comments on commit e959f2d

Please sign in to comment.