Sorry, I'm confused.

I navigated to each of my content types and enabled (checked) "Index content of this type." I then enabled Simple Sitemap for my Taxonomy terms.

I then navigated to "Configuration > Simple XML Sitemap Settings" and pressed the "Regenerate Content" button and -- after processing the request -- Simple XML Sitemap reported "The XML sitemap has been regenerated for all languages." I then loaded http://www.MyDomain.com/sitemap.xml which resulted in this...

<urlset>
  <url>
    <loc>http://www.MyDomain.com/</loc>
      <priority>1.0</priority>
    </url>
</urlset>

Where are the mappings to all of my content types and taxonomy?

In addition, there does not appear to be any sitemap.xml file located in my site's root directory (when I look with my FTP client).

What am I doing wrong?

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Q2U2 created an issue. See original summary.

gbyte’s picture

You do not appear to be doing anything wrong.

There is no physical file, as sitemaps are cached in the database (as a matter of fact you will not find any pages you create on the server via ftp). Most pages in Drupal (and most CMSs for that matter) are created dynamically from the DB.

If you find links are missing on the sitemap, make sure the content you intend to index is viewable by anonymous users.

If that's the case and regenerating the sitemap doesn't work for some reason, please clear caches, regenerate again. Waiting for your report.

Is your site public, can you provide its address? No worries, I see you provided the address on my blog. :)

gbyte’s picture

Can you please try the dev version? I've noticed a cache invalidation problem and temporarily addressed it in the dev version. Please do not forget to clear the caches after updating the module files. Looking forward to your report.

Q2U’s picture

Thank you very much for your quick response. I performed the following steps...

  1. Put my D8.0.4 site in Maintenance Mode
  2. Uninstalled Simple Site Map 8.x-2.1 (Recommended Release)
  3. Used my FTP client to delete the Simple Site Map 8.x-2.1 directory on my web server
  4. Cleared my site cache
  5. Installed Simple Site Map 8.x-2.x-dev (Dev Release)
  6. Cleared my site cache again because...well because I'm essentially Qlueless
  7. Revisited all of the content types which I want included in my XMP SiteMap
  8. Navigated to Configuration > Simple XML Sitemap Settings and regenerated my SiteMap
  9. And there is joy! My XML site map is alive in all its depth and glory

Hey, thanks a lot GB! My issue may well be cache related as you surmised.

gbyte’s picture

Title: I'm confused... » Sitemap only updated after clearing the cache
Component: Documentation » Code
Category: Support request » Bug report
Status: Active » Closed (fixed)
Issue tags: -Documentation?

That's great!

Anonymous’s picture

Version: 8.x-2.1 » 8.x-2.x-dev
Status: Closed (fixed) » Active

The sitemap still doesn't get updated with the caching enabled. After disabling the cache I got the sitemap generated.

Anonymous’s picture

As soon as I enable the cache the sitemap gets empty again.

gbyte’s picture

Have you cleared the cache after upgrading to the dev version?

Anonymous’s picture

Status: Active » Closed (fixed)

Yes, I did clear the cache. But for some reason after reinstalling it works.

lmedrano’s picture

I cleared cache, installed dev version and followed step by srep instructions on #4 and #8, but nothing, just a blank page (on firefox) with the custom links on it (just text, no links).
I have moved my site from localhost to live server.

Any other idea?

Anonymous’s picture

Imedrano you should notice that currently this ticket is marked as closed. Please make sure to mark it as open if the issue persists.

gbyte’s picture

@Imedrano The ticket was marked closed, hence I did not see your post.

The "blank page with custom links on it" is correct, this is how firefox interprets hreflang sitemaps. Press ctrl+u to see what the bots see. If you are missing content type links, you haven't configured your sitemap yet. Please read the readme.txt file from the module root directory.

As mentioned, if your problem persists, please reopen the ticket.

ws.agency’s picture

Status: Closed (fixed) » Active

I am reopening this ticket. Its confusing because regenerated sitemap is visible only after clearing the caches. I think this module should invalidate sitemap cache whenever "Regenerate sitemap" option is used.

gbyte’s picture

This should be the case with the dev version of the 2.x branch. Please get back to me with your findings.

hctom’s picture

We are experiencing similar problems with our sitemap. We are using the latest dev-release (with commit 134f4ee0cc0092c6bcbbbee4d4abdc7360d9fe8d) and here are the steps to reproduce our problems:

  1. Create tons of content on your site (e.g. via devel_generate or Drupal Console)
  2. Configure sitemap settings to include content and hit the "Regenerate sitemap button" on /admin/config/search/simplesitemap
  3. Do not wait until generation is done, just head over to /sitemap.xml - you will see the sitemap with the currently added items
  4. Wait for generation to finish and access /sitemap.xml again - No changes are present, the last accessed state is displayed
  5. Clear all caches and visit /sitemap.xml - All items are present now

This may really cause problems, e.g. when the sitemap crawler visits the sitemap during regeneration (e.g. via cron), then the sitemap might even be completely empty and won't display real content until either the caches are cleared or the sitemap is generated again.

I'd appreciate your help, if there is an easy fix for this. I will also dig through the code to see if I can find a place, where to invalidate cache at the end of the generation. If I find something, I will provide a patch.

hctom’s picture

Status: Active » Needs review
FileSize
525 bytes

Okay, this was easy ;) Here is the proposed patch with cache tag invalidation for the sitemap output

gbyte’s picture

Status: Needs review » Fixed

@hctom thanks for your observations. I can't use your patch, as it would trigger a cache clear after the creation of every single sitemap chunk. I have moved the cache invalidation to the function triggered when batch finishes.
Please test and feel free to reopen the issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

raj45’s picture

My sitemap would occasionally disappear for no apparent reason, and only re-appeared after manually running cron, so I have resorted to running cron every 15th minute, with this in my crontab:

## run cron every 15th minute mainly to generate site map - MAILTO set to empty due to irrelevant mail alert about empty result page
MAILTO=""
*/15 * * * * /usr/bin/lynx -source http://example.com/cron/VSrV3PWUNEhAbVa-OTlzZgh9duQCLRjYN7xhi-yQcX1BaqqkeKZfsh_gGtbJp37OyGIFpMG8azA?0%5Babsolute%5D=1 
Q2U’s picture

+1...I believe I'm having the same issue. For no readily apparent reason -- occasionally -- my sitemap isn't present when it is called, as shown in the screenshot below...

http://www.stonetonwestllc.com/Q/sitemap-screenshot.jpg

To remedy the issue I need to regenerate sitemap my sitemap manually.

raj45’s picture

Status: Closed (fixed) » Active

Setting Status to Active again.

hctom’s picture

As far as i see, The Problem is that cron regenerates the Sitemap in a single process with no real Batch. So if you have a lot of content this may lead to a timeout

raj45’s picture

@hctom: I only have 135 pages, so missing Batch process shouldn't be the problem in my case ...

Q2U’s picture

I only have a couple hundred pages also.

This issue should probably have been entered as a separate and distinct issue.

My sitemap disappears regularly, as shown below...

http://www.stonetonwestllc.com/sites/default/files/google-sitemap-error.jpg

Q2U’s picture

Priority: Normal » Critical

Changing status to "Critical."

gbyte’s picture

Priority: Critical » Normal
Status: Active » Closed (fixed)

I cannot reproduce this in any of my projects, so it would be very beneficial if you could figure out when and how this happens.
#2711761: Sitemap sometimes disappearing may be related?
But first of all please open a new ticket for this issue for 8.x-2.x-dev.

gbyte’s picture

Debasish147’s picture

FileSize
126.14 KB

Still the issue of invalidate cache is there. After generation of sitemap, if one content title has changed then that is not reflecting in sitemap. We have to hit regenerate again to get that update title as reflected.

Please find the attach screen shot , in which we are getting cache tags are missing. Can you reopen the issue as cache is not working properly.

gbyte’s picture

@Debasish147 Your problem is not cache I believe. The sitemap will never update after you change a piece of content, as these files are a snapshot of what your site looks like at a time. The sitemap can be set to regenerate on cron runs, or you can click 'regenerate after clicking save' when making changes to content sitemap settings.

RaghvendraG made their first commit to this issue’s fork.

Oscaner’s picture

FileSize
947 bytes
Oscaner’s picture

FileSize
982 bytes
663 bytes