Stevy Liakopoulou provides a guide on optimizing e-commerce sitemaps with over 1 million pages.
Hierarchy and Organization: Group URLs logically in the sitemap to mirror the website's navigation. Use sub-sitemaps based on product, categories, or other relevant topics. For multilingual sitemaps, create a separate sitemap for each language.
Categories/Subcategories with 0 or 1 Product: Merge categories and subcategories with zero or one product with other relevant categories or set a 301 redirection to relevant categories and remove them from the sitemap.
Product Pages with 0 Content/Duplicated Content: Identify which products are important for business revenue. Manually optimize these with unique content, keywords, meta descriptions, FAQs, videos, images, and schema markup. Gradually optimize less important products or tag them as no-index and remove from the sitemap.
Out-of-Stock Products: Treat out-of-stock products as soft 404 errors. For permanently out-of-stock products, if they generate traffic, have backlinks, or contribute to business revenue, set a 301 redirection to other relevant products. If not, give them a 410 HTTP status and remove from the sitemap and product feed. For temporarily out-of-stock products, notify the user about the product's future availability, and update the schema markup.
Products with Multiple Variations: Set the variation generating the most traffic, backlinks, or revenue as the canonical tag for all other variations. Include only this variation in the sitemap, but regularly audit the popularity of variations and update the sitemap accordingly.
Errors: Remove pages reported as 404 from the sitemap. Correct pages with redirection issues and then remove them from the sitemap. Note pages reported with several issues, and gradually decrease the number of pages in the sitemap. Review and optimize pages reported as soft 404 pages accordingly, or set a 301 redirection rule and remove from the sitemap.