From 0cfb161e53658761ea1ebad9f72b523bdf099e66 Mon Sep 17 00:00:00 2001 From: Diego Najar Date: Fri, 21 Jun 2019 10:26:38 +0200 Subject: [PATCH] Remove page from Sitemap when are setted as noindex #1054 --- bl-plugins/sitemap/plugin.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/bl-plugins/sitemap/plugin.php b/bl-plugins/sitemap/plugin.php index 3ea996b2..8119323d 100644 --- a/bl-plugins/sitemap/plugin.php +++ b/bl-plugins/sitemap/plugin.php @@ -62,11 +62,13 @@ class pluginSitemap extends Plugin { try { // Create the page object from the page key $page = new Page($pageKey); - $xml .= ''; - $xml .= ''.$page->permalink().''; - $xml .= ''.$page->date(SITEMAP_DATE_FORMAT).''; - $xml .= 'daily'; - $xml .= ''; + if (!$page->noindex() && !$page->noarchive()) { + $xml .= ''; + $xml .= ''.$page->permalink().''; + $xml .= ''.$page->date(SITEMAP_DATE_FORMAT).''; + $xml .= 'daily'; + $xml .= ''; + } } catch (Exception $e) { // Continue }