This project is read-only.

Deleted Items Remain in Sitemap

Topics: Developer Forum
Mar 2, 2010 at 2:27 AM

Dear Chris,

I observed when I delete a category its URL remain in the Sitemap table.So the generated xml sitemap will include some URLs that are not working and this will effect crawling the sitemap URLs in general (Crawling Rating).Don't you think this could be a problem that need to be solved?

Best Regards,


Mar 27, 2010 at 5:15 PM

You are correct, I called the wrong method in my sitemap HttpHandler. It should have called the GetActiveSiteMapNodes() instead. The reason I retain all records in my tables is for accountability. I learned early in my career to add a flag to indicate the state of a record and to never delete the record. So I have always had an Active boolean flag as a field on almost all tables since I was in college. Saved my butt as well as clients/employers many many times.

            Response.ContentType = "application/xml";
            using (var siteMaprpt = new SiteMapRepository())
                lsiteMapNodes = siteMaprpt.GetActiveSiteMapNodes();
            if (lsiteMapNodes != null)
Mar 27, 2010 at 6:37 PM
Edited Mar 27, 2010 at 6:43 PM

Happy to have you back after a long time..I realy need your help to solve my problems and move on in my project since I'm using your project and your book as a main reference.

Thank you for replying for all my posts in this forum this was very kind from you.I will read your other posts and reply for them but about this one you solved my problem already..thank you very much.Hope that we continue in contact as long as possible...