The Moz Q&A Forum

    • Forum
    • Questions
    • My Q&A
    • Users
    • Ask the Community

    Welcome to the Q&A Forum

    Browse the forum for helpful insights and fresh discussions about all things SEO.

    1. SEO and Digital Marketing Q&A Forum
    2. Categories
    3. Intermediate & Advanced SEO
    4. Why do people put xml sitemaps in subfolders? Why not just the root? What's the best solution?

    Why do people put xml sitemaps in subfolders? Why not just the root? What's the best solution?

    Intermediate & Advanced SEO
    3 2 3.3k
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as question
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • McTaggart
      McTaggart last edited by

      Just read this: "The location of a Sitemap file determines the set of URLs that can be included in that Sitemap. A Sitemap file located at http://example.com/catalog/sitemap.xml can include any URLs starting with http://example.com/catalog/ but can not include URLs starting with http://example.com/images/." here: http://www.sitemaps.org/protocol.html#location

      Yet surely it's better to put the sitemaps at the root so you have:
      (a) http://example.com/sitemap.xml 
      http://example.com/sitemap-chocolatecakes.xml
      http://example.com/sitemap-spongecakes.xml 
      and so on...

      OR this kind of approach - 
      (b) http://example/com/sitemap.xml
      http://example.com/sitemap/chocolatecakes.xml and 
      http://example.com/sitemap/spongecakes.xml

      I would tend towards (a) rather than (b) - which is the best option?

      Also, can I keep the structure the same for sitemaps that are subcategories of other sitemaps - for example - for a subcategory of http://example.com/sitemap-chocolatecakes.xml I might create http://example.com/sitemap-chocolatecakes-cherryicing.xml - or should I add a sub folder to turn it into http://example.com/sitemap-chocolatecakes/cherryicing.xml

      Look forward to reading your comments - Luke

      1 Reply Last reply Reply Quote 0
      • HiveDigitalInc
        HiveDigitalInc last edited by

        Consider this:  "The location of a Sitemap file determines the set of URLs that can be included in that Sitemap. A Sitemap file located at http://example.com/catalog/sitemap.xml can include any URLs starting with http://example.com/catalog/ but can not include URLs starting with http://example.com/images/." here: http://www.sitemaps.org/protocol.html#location

        B would not be an acceptable approach as http://example.com/sitemap/chocolatecakes.xml could only contain a sitemap of content located in http://example.com/sitemap.   For this same reason, you couldn't create sitemaps in subfolder directories...

        This is the best approach from those options you mentioned...

        (a) http://example.com/sitemap.xml 
        http://example.com/sitemap-chocolatecakes.xml 
        http://example.com/sitemap-spongecakes.xml
        http://example.com/sitemap-chocolatecakes-cherryicing.xml

        It is worth noting that you can have a sitemap of sitemaps.. so for example.

        http://example.com/sitemap.xml could contain links to http://example.com/sitemap-cakes,  http://example.com/sitemap-articles, etc..
        http://example.com/sitemap-cakes.xml could contain links to http://example.com/sitemap-chocolatecakes.xml, http://example.com/sitemap-vanilla-cakes.xml, etc..

        Try not to over-complicate things by trying to create sub-category sitemaps, etc.. Unless you have an exorbitant amount of sub-category pages, or have directories/sections managed by different cms, etc.

        You generally see large sites will have a separate sitemap based on content type (company pages, category pages, product pages, blog pages)

        1 Reply Last reply Reply Quote 3
        • McTaggart
          McTaggart last edited by

          Thanks Angular Marketing, and Everett... very helpful feedback and much appreciated. Luke
          
          1 Reply Last reply Reply Quote 1
          • 1 / 1
          • First post
            Last post
          • I need help on how best to do a complicated site migration. Replacing certain pages with all new content and tools, and keeping the same URL's. The rest just need to disappear safely. Somehow.
            Everett
            Everett
            1
            4
            58

          • Xml sitemap Issue... Xml sitemap generator facilitating only few pages for indexing
            Paddy_Moogan
            Paddy_Moogan
            0
            6
            153

          • Site Structure: How do I deal with a great user experience that's not the best for Google's spiders?
            KristinaKledzik
            KristinaKledzik
            0
            3
            138

          • XML Sitemaps - how to create the perfect XML Sitemap
            AlanMosley
            AlanMosley
            0
            2
            3.5k

          • Is there any negative SEO effect of having comma's in URL's?
            gcdtechnologies
            gcdtechnologies
            0
            3
            2.6k

          • What's the best method for segmenting HTML sitemap?
            RyanKent
            RyanKent
            0
            2
            731

          • Best solution to get mass URl's out the SE's index
            James77
            James77
            0
            3
            583

          • Don't want to lose page rank, what's the best way to restructure a url other than a 301 redirect?
            marig
            marig
            0
            6
            1.0k

          Get started with Moz Pro!

          Unlock the power of advanced SEO tools and data-driven insights.

          Start my free trial
          Products
          • Moz Pro
          • Moz Local
          • Moz API
          • Moz Data
          • STAT
          • Product Updates
          Moz Solutions
          • SMB Solutions
          • Agency Solutions
          • Enterprise Solutions
          • Digital Marketers
          Free SEO Tools
          • Domain Authority Checker
          • Link Explorer
          • Keyword Explorer
          • Competitive Research
          • Brand Authority Checker
          • Local Citation Checker
          • MozBar Extension
          • MozCast
          Resources
          • Blog
          • SEO Learning Center
          • Help Hub
          • Beginner's Guide to SEO
          • How-to Guides
          • Moz Academy
          • API Docs
          About Moz
          • About
          • Team
          • Careers
          • Contact
          Why Moz
          • Case Studies
          • Testimonials
          Get Involved
          • Become an Affiliate
          • MozCon
          • Webinars
          • Practical Marketer Series
          • MozPod
          Connect with us

          Contact the Help team

          Join our newsletter
          Moz logo
          © 2021 - 2026 SEOMoz, Inc., a Ziff Davis company. All rights reserved. Moz is a registered trademark of SEOMoz, Inc.
          • Accessibility
          • Terms of Use
          • Privacy