The feature to add URLs to the sitemap file is useful but it would also be very valuable to be able to add an external xml sitemap file.
I run PhpGedView outside Drupal. It generates its own xml sitemap file which has to be manually updated downloaded and uploaded. However it works, even if it is tedious. Google allows you to register more than one file but other search engines do not. It would be very helpful simply to add the PhpGedView file to the Drupal sitemap.xml. Reference: http://shepsplace.net/sitemap.xml and http://shepsplace.net/SM_family.xml

Comments

dave reid’s picture

I'm not sure how this could be done. Technically that's a 'separate' site from the Drupal site. I think your best way is to manually add that sitemap yourself from Google Webmaster Tools, Yahoo site explorer, etc.

KempJ’s picture

Perhaps it would be possible to have the option to select the external sitemap in the xmlsitemap admin area. Then generate the main sitemap as an index to the 'real' one and the external one (like when there's a lot of links in the 'real' one). Don't know how practical that would be though, do the child sitemaps need to have certain fixed names?

Anonymous’s picture

I would suggest a new module with a name something similar to root_xmlsitemap. This new module would allow disparate sitemap.xml files to be indexed in a sitemap index file. There is nothing wrong with an indexed file being another index so if this module (xmlsitemap) creates more than one sitemap file it just works.

The problematic issue will be the name of the sitemap.xml file created by the root_xmlsitemap module. It might be necessary to allow the user to name the URI reference created by xmlsitemap so that root_xmlsitemap can create the common sitemap.xml name.

dave reid’s picture

Ack ack! The biggest thing to look at is that each XML sitemap should be though of as a separate site, so Drupal shouldn't have to handle anything with it. Especially with the upcoming changes of defining sitemap 'contexts', I can't see any non-ugly-hack way it could be done to get a non-Drupal sitemap listed from inside the Drupal sitemap.

The only place or way that I think we could add this is support for listing the sitemaps in hook_robotstxt() and when pinging to search engines.

Anonymous’s picture

My idea isn't to include an external sitemap in the xmlsitemap output but to create a new module that creates an index file containing all of the sitemap entries it is told about. The problem with the idea is that you either have a someothersitemap.xml name you give the engines or xmlsitemap allows the user to name the sitemap.xml to something else.

So root_xmlsitemap (if that is what the other module is called) would create a sitemap index xml file that points to the other possible sitemaps and rootsitemap.xml is given to the search engines as the sitemap.xml file and it contains index representations pointing to sitemap.xml and whatever.xml.

So if you want to consider the feature of allowing the user to name sitemap.xml something else, we can change the title and go with that else we set the status to won't fix and allow the OP or someone else to create the root_xmlsitemap module knowing the limitations. I do agree that xmlsitemap cannot include some other sitemap data.

dave reid’s picture

Status: Active » Postponed

With the upcoming concepts of 'context' and having different sitemaps per language and domain, doing this feature becomes even more complex since we'd have to ensure for each sitemap generated that the external sitemaps are in a sub-path of that current sitemap. Plus we'd have to validate that the external sitemap isn't itself an index, although the specification is unclear if you can have an sitemap index, pointing to another index of sitemaps.

For now I'm going to leave this as postponed as it's not very high on my list and I've got to get the context code and UI finished first. After that I could see how if something like a root_sitemap is possible.

grahamshepherd’s picture

Thanks for all the thoughtful comments. I hope that a way of doing it conveniently surfaces at some time. I appreciate the huge amount of work that has gone into this module and realise that my priorities aren't necessarily everyone else's.

dave reid’s picture

Version: 6.x-2.x-dev » 7.x-2.x-dev

Technically you could possibly use the 'XML sitemap custom' sub-module and make the external sitemap a new custom link. I'm not sure what Google does when you link a sitemap from within another sitemap that is not an index itself.

Also, you could use the robots.txt (or the RobotsTxt module to add Sitemap: http://shepsplace.net/SM_family.xml so it gets auto-discovered by search engines.

pifagor’s picture

Issue summary: View changes
Status: Postponed » Closed (won't fix)
jwilson3’s picture

See https://support.google.com/webmasters/answer/75712?hl=en

You have to create a sitemapindex following this syntax:

<?xml version="1.0" encoding="UTF-8"?>
   <sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
   <sitemap>
      <loc>http://www.example.com/sitemap1.xml.gz</loc>
      <lastmod>2004-10-01T18:23:17+00:00</lastmod>
   </sitemap>
   <sitemap>
      <loc>http://www.example.com/sitemap2.xml.gz</loc>
      <lastmod>2005-01-01</lastmod>
   </sitemap>
   </sitemapindex>

I would manually create this file in your projects web root at sitemapindex.xml

Then add in the files created by xmlsitemap module, plus any other custom sitemaps that you have. Then submit this new sitemapindex.xml to Google, and also add this file, plus the additional sitemaps to robots.txt (mentioned in previous comments).