diff --git a/prerender/seo/feeds.cjs b/prerender/seo/feeds.cjs index 3df07cf..b0ada0e 100644 --- a/prerender/seo/feeds.cjs +++ b/prerender/seo/feeds.cjs @@ -316,6 +316,27 @@ const generateProductsXml = (allProductsData = [], baseUrl, config) => { return; } + // Skip products with excluded terms in title or description + const productTitle = (product.name || "").toLowerCase(); + const productDescription = (product.description || "").toLowerCase(); + + const excludedTerms = { + title: ['canna', 'hash', 'marijuana'], + description: ['cannabis'] + }; + + // Check title for excluded terms + if (excludedTerms.title.some(term => productTitle.includes(term))) { + skippedCount++; + return; + } + + // Check description for excluded terms + if (excludedTerms.description.some(term => productDescription.includes(term))) { + skippedCount++; + return; + } + // Skip products without GTIN if (!product.gtin || !product.gtin.toString().trim()) { skippedCount++;