Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
On a current project I have a site with multiple languages where english is the default language.
I'm getting a different sitemap.xml depending on how I trigger the generation.
The below ways will trigger a seemingly correct sitemap containing urls for all languages and alternate language links for each node.
- Clicking Regenerate sitemap at
/admin/config/search/simplesitemap
- Clicking Run cron at
/admin/config/system/cron
while having "Regenerate the sitemap on every cron run" checked
The below ways will trigger a sitemap containing only urls to English nodes with no alternate language links.
- Drush command:
simple_sitemap-generate
- Running cron via url
/cron/ABCDEFGHXYZ...
while having "Regenerate the sitemap on every cron run" checked
I have tried changing "Exclude duplicate links" and "Skip non-existent translations" but it doesn't seem to fix the issue.
Please let me now if I can provide any more info!
Comment | File | Size | Author |
---|---|---|---|
#3 | sitemap2.txt | 32.88 KB | reekris |
#3 | sitemap1.txt | 351.17 KB | reekris |
Comments
Comment #2
gbyte CreditAttribution: gbyte as a volunteer and at gbyte commentedI cannot reproduce this, just generated a multilingual sitemap with both the UI and then drush and no difference there. Are you sure the drush generation triggers the correct site (in case you are in a multi site environment)?
Please press ctrl+u on the sitemap page and provide source for both variants.
Comment #3
reekris CreditAttribution: reekris commentedI'm not in a multisite environment so pretty sure I''m triggering the correct site. Also, the cron url is actually on the Cron page at
/admin/config/system/cron
. If I click on Run cron it generates a different sitemap compared to clicking on the cron url link.I have attached the two different versions as txt (xml is not allowed). sitemap1 is generated via clicking regenerate sitemap or run cron. sitemap2 is generated via drush or the cron url.
Note that there are a lot of weird looking urls in sitemap1. It is because of the site having chinese and japanese languages and their urls gets encoded like that, which I believe is correct.
Comment #4
gbyte CreditAttribution: gbyte as a volunteer and at gbyte commentedUnfortunately I cannot reproduce it on any of my instances. I tried all the combinations above and it gives me the same results with all translated entities linked in the sitemap. Can you please try and reproduce this on a fresh Drupal instance? Until then, I will mark it as 'cannot reproduce'.
Comment #5
gbyte CreditAttribution: gbyte as a volunteer and at gbyte commentedFixed in 3.x with #3102450: Manual generated sitemap differs from drush and cron generated.