We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19872
    • 1,078 Posts
    I recently used a MODx add-on for creating my sites's sitemap.xml file that worked terrific. However, the structure of the XML appears as straight text, and is not as an unordered list as I am used to seeing. Is the structure important? Does Google and other search engines need a doctype, and the information in a list format? I only asked because my site is no where on the radar of Google. So this query here is one part of my troubleshooting phase.

    My current sitemap.xml looks like this (as found when navigating to http://www.mydomain.com/sitemap.xml)
    http://www.mydomain.com/ 2013-06-15 daily 1.0 http://www.mydomain.com/menu.html 2013-06-08 weekly 0.50 http://www.mydomain.com/about/ 2013-06-15 daily 1.0 http://www.mydomain.com/about/chef.html 2013-06-08 weekly 0.50 http://www.mydomain.com/about/proprietors.html 2013-06-08 weekly 0.50 http://www.mydomain.com/contact.html 2013-06-08 weekly 0.50

    I'm guessing the filetype is correct, otherwise, sitemap.xml would return a 404.

    I'm using the add-on: GoogleSiteMap
      • 19872
      • 1,078 Posts
      Maybe the appropriate term here is "Sitemap tag definitions" (i.e. <urlset>, <url>, <loc>, <lastmod>, <changefreg>

      My sitemap that was generated by GoogleSiteMap Add-on contains no sitemap tag definitions, and I wonder if this is hindering SEO.

      I see that the content generated is in a logical order, but it does not have the actual tag definitions. Maybe GoogleSiteMap presented the information in a compressed format, and this is fine?
        • 22840
        • 1,572 Posts
        Your sitemap.xml file should have the structure of the below if it's for google and each page on the site will follow that with the same:

        <url>
        <loc>http://www.yourdomain.co.uk/</loc>
        <lastmod>2013-06-16</lastmod>
        <changefreq>daily</changefreq>
        <priority>1.0</priority>
        </url>
        


        I use the GoogleSiteMap package which outputs it like the above ( http://rtfm.modx.com/display/ADDON/GoogleSiteMap )

        You need to call it with:

        [[!GoogleSiteMap]]


        and ensure it has a content type of XML ( under the settings tab when editing the page ) [ed. note: paulp last edited this post 13 years, 3 months ago.]
          • 19872
          • 1,078 Posts
          Thanks for the quick response Paul. I am calling it with GoogleSiteMap, and yes, it's of primary important that the sitemap be structured for google. And, my content type is set to XML.

          On a whim, I checked another site I worked on last night (non-modx) where I had created the sitemap using an online sitemap generator. When I navigated to that xml file in Safari, it displays on screen exactly as is appears with my MODx site—kind of all one line of type.

          So.... indeed, GoogleSiteMaps is working properly. It's just the different between viewing the xml file in a browser vs. viewing it in TextWrangler or DreamWeaver.

          Case solved.

          Thank you.

          Quote from: paulp at Jun 16, 2013, 09:15 AM
          Your sitemap.xml file should have the structure of the below if it's for google and each page on the site will follow that with the same:

          <url>
          <loc>http://www.yourdomain.co.uk/</loc>
          <lastmod>2013-06-16</lastmod>
          <changefreq>daily</changefreq>
          <priority>1.0</priority>
          </url>
          


          I use the GoogleSiteMap package which outputs it like the above ( http://rtfm.modx.com/display/ADDON/GoogleSiteMap )

          You need to call it with:

          [[!GoogleSiteMap]]


          and ensure it has a content type of XML ( under the settings tab when editing the page )
            • 22840
            • 1,572 Posts
            You can't view it correctly in any editor as it needs modx to output what is generated after modx has done its magic, the only way to see what the search engines see is to view it in the browser ;o)
              • 32699 ☆ A M B ☆
              • 427 Posts
              There are two different types of sitemaps: one for search engines - typically in XML and one for people - typically in an unordered list.

              GoogleSiteMap can create either, the XML version compatible with Search Engines is default, you simply need to create your own template Chunks to create unordered lists and call them with the appropriate snippet call:

              itemTpl - The Chunk to use for each result listed.
              containerTpl - The Chunk to use for wrapping the results.
              


              If you are using Google Webmaster Tools or Bing they have facilities to verify your site map is readable and acceptable to their specific platform.

              You can also utilize http://www.xml-sitemaps.com/validate-xml-sitemap.html
                Get your copy of MODX Revolution Building the Web Your Way http://www.sanitypress.com/books/modx-revolution-building-the-web-your-way.html

                Check out my MODX || xPDO resources here: http://www.shawnwilkerson.com
                • 19872
                • 1,078 Posts
                Paul chimed in on my post and I determined that there is a difference between the way the .xml file displays in a browser vs. a web text editor and am pretty sure that my sitemap.xml is OK.

                I have another site that is traditional html for which I used an online sitemap.xml generator. That site's sitemap file when viewed in the browser window looks just like what is being generated by GoogleSiteMap in MODx. So... I think I'm good to go.

                An yes—my SEO validation tool confirmed that the sitemap verified out ok.

                Thanks for the response. Great feedback.

                Marc