How do I add approx 3000 custom URLS to sitemap.xml

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
1 year ago
I have read forums and articles regarding this but it is not clear.

I see this in settings :
sitemapxmlsettings.sitemapcustomurls  
but how can I add 3000 urls to it?

I tried adding a few separated by
,
but not sure if it is correct.

Please let me know what I need to do If I need to add approx 3000 or more custom URLS to
sitemap.xml.
1 year ago
Have managed to put more than 100k urls :

Update the below function in :
Nop.Services\Seo\SitemapGenerator.cs


  
 protected virtual IEnumerable<SitemapUrl> GetCustomUrls()
        {
            var storeLocation = _webHelper.GetStoreLocation();
            var customUrls = new List<string>();

            var filePath = Path.Combine(_hostingEnvironment.ContentRootPath, "App_Data", "custom-urls.txt");
            if (File.Exists(filePath))
            {
                customUrls = File.ReadAllLines(filePath).ToList();
            }

            var sitemapUrls = new List<SitemapUrl>();

            foreach (var customUrl in customUrls)
            {
                var url = string.Concat(storeLocation, customUrl);
                sitemapUrls.Add(new SitemapUrl(url, new List<string>(), UpdateFrequency.Weekly, DateTime.UtcNow));
            }

            return sitemapUrls;

            //return _sitemapXmlSettings.SitemapCustomUrls.Select(customUrl =>
            //    new SitemapUrl(string.Concat(storeLocation, customUrl), new List<string>(), UpdateFrequency.Weekly, DateTime.UtcNow));
        }
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.