Skip to content

Commit

Permalink
Excluding future entries from the sitemap
Browse files Browse the repository at this point in the history
  • Loading branch information
jonrcarey committed Mar 7, 2024
1 parent 2a22498 commit f1c41d7
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 f1c41d7

Please sign in to comment.