From f1c41d74f484d611adc7caa5912d3e906357d759 Mon Sep 17 00:00:00 2001 From: Jonathan Carey Date: Thu, 7 Mar 2024 11:34:26 +0000 Subject: [PATCH] Excluding future entries from the sitemap --- src/Sitemaps/Sitemap.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Sitemaps/Sitemap.php b/src/Sitemaps/Sitemap.php index 424b1a2..bc82d3d 100644 --- a/src/Sitemaps/Sitemap.php +++ b/src/Sitemaps/Sitemap.php @@ -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':