XF 2.2 Confused by sitemaps...

RobParker

Well-known member
Could someone explain how XF creates sitemaps as I think I'm missing something.

The admin page says:
If this option is enabled, the sitemap will be rebuilt automatically periodically. If this option is disabled, the sitemap will only be updated when it is rebuilt manually through Tools > Rebuild caches. The current sitemap can be accessed via sitemap.php.

That link to sitemap.php is ourdomain.co.uk/sitemap.php but that contains the following:

<sitemapindex>
<sitemap>
<loc>https://www.ourdomain.co.uk/sitemap-1.xml</loc>
<lastmod>2021-08-13T22:38:22+00:00</lastmod>
</sitemap>
<sitemap>
<loc>https://www.ourdomain.co.uk/sitemap-2.xml</loc>
<lastmod>2021-08-13T22:38:22+00:00</lastmod>
</sitemap>
</sitemapindex>

Those 2 xml files don't exist (404 errors).

Do I have something configured incorrectly?
 
Solution
A rather long story short, you will need full friendly URLs enabled for the sitemap URLs that end in .xml to actually work.

Once the sitemap grows beyond 50,000 URLs it has to be split into separate .xml files, as in your case. Prior to the 50,000 URLs limit, sitemap.php will work but in reality we've seen Google ignore sitemaps unless they have a .xml extension.

Once you have full friendly URLs enabled, you can actually just use the URL sitemap.xml to access the index page and then sitemap-1.xml and so on will work.
I know this is an old thread, but I am heaving a hell of a time with sitemaps myself and my users are requesting them. This is the error I received when I tried to run the cron to rebuild:


Code:
Server error log

    GuzzleHttp\Exception\ClientException: Error submitting sitemap to https://www.google.com/webmasters/tools/ping?sitemap=https%3A%2F%2Fuorealms.com%2Frealms%2Fsitemap.php: Client error: `GET https://www.google.com/webmasters/tools/ping?sitemap=https%3A%2F%2Fuorealms.com%2Frealms%2Fsitemap.php` resulted in a `404 Sitemaps ping is deprecated. See https://developers.google.com/search/blog/2023/06/sitemaps-lastmod-ping.` response: <HTML> <HEAD> <TITLE>Sitemaps ping is deprecated. See https://developers.google.com/search/blog/2023/06/sitemaps-lastmod (truncated...) src/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:113

    Generated by: Unknown account Jan 8, 2024 at 11:03 PM

Stack trace

#0 src/vendor/guzzlehttp/guzzle/src/Middleware.php(65): GuzzleHttp\Exception\RequestException::create(Object(GuzzleHttp\Psr7\Request), Object(GuzzleHttp\Psr7\Response))
#1 src/vendor/guzzlehttp/promises/src/Promise.php(204): GuzzleHttp\Middleware::GuzzleHttp\{closure}(Object(GuzzleHttp\Psr7\Response))
#2 src/vendor/guzzlehttp/promises/src/Promise.php(153): GuzzleHttp\Promise\Promise::callHandler(1, Object(GuzzleHttp\Psr7\Response), NULL)
#3 src/vendor/guzzlehttp/promises/src/TaskQueue.php(48): GuzzleHttp\Promise\Promise::GuzzleHttp\Promise\{closure}()
#4 src/vendor/guzzlehttp/promises/src/Promise.php(248): GuzzleHttp\Promise\TaskQueue->run(true)
#5 src/vendor/guzzlehttp/promises/src/Promise.php(224): GuzzleHttp\Promise\Promise->invokeWaitFn()
#6 src/vendor/guzzlehttp/promises/src/Promise.php(269): GuzzleHttp\Promise\Promise->waitIfPending()
#7 src/vendor/guzzlehttp/promises/src/Promise.php(226): GuzzleHttp\Promise\Promise->invokeWaitList()
#8 src/vendor/guzzlehttp/promises/src/Promise.php(62): GuzzleHttp\Promise\Promise->waitIfPending()
#9 src/vendor/guzzlehttp/guzzle/src/Client.php(182): GuzzleHttp\Promise\Promise->wait()
#10 src/vendor/guzzlehttp/guzzle/src/Client.php(95): GuzzleHttp\Client->request('get', 'https://www.goo...', Array)
#11 src/XF/Sitemap/Builder.php(515): GuzzleHttp\Client->__call('get', Array)
#12 src/XF/Sitemap/Builder.php(432): XF\Sitemap\Builder->sendPing()
#13 src/XF/Sitemap/Builder.php(73): XF\Sitemap\Builder->completeBuild()
#14 src/XF/Job/Sitemap.php(27): XF\Sitemap\Builder->build(7.73156)
#15 src/XF/Job/Manager.php(260): XF\Job\Sitemap->run(8)
#16 src/XF/Job/Manager.php(202): XF\Job\Manager->runJobInternal(Array, 8)
#17 src/XF/Job/Manager.php(86): XF\Job\Manager->runJobEntry(Array, 8)
#18 src/XF/Cli/Command/RunJobs.php(59): XF\Job\Manager->runQueue(false, 8)
#19 src/vendor/symfony/console/Command/Command.php(255): XF\Cli\Command\RunJobs->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#20 src/vendor/symfony/console/Application.php(992): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#21 src/vendor/symfony/console/Application.php(255): Symfony\Component\Console\Application->doRunCommand(Object(XF\Cli\Command\RunJobs), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#22 src/vendor/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#23 src/XF/Cli/Runner.php(111): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#24 cmd.php(15): XF\Cli\Runner->run()
#25 {main}

Request state

array(1) {
  ["cli"] => string(60) "/home/uorealms/public_html/realms/cmd.php xf:run-jobs --wait"
}

Delete

and if i goto sitemap.php or sitemap.xml I get this:

Code:
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<urlset>
<url>
<loc>https://uorealms.com/realms/</loc>
</url>
<url>
<loc>https://uorealms.com/realms/bbs</loc>
</url>
<url>
<loc>
https://uorealms.com/realms/articles/faerham-citadel-new-player-guide.4/
</loc>
<lastmod>2023-12-05T04:58:54+00:00</lastmod>
</url>
<url>
<loc>
https://uorealms.com/realms/articles/categories/uorealms-servers.1/
</loc>
</url>
<url>
<loc>
https://uorealms.com/realms/articles/categories/storytelling-and-roleplay.2/
</loc>
</url>
<url>
<loc>
https://uorealms.com/realms/articles/categories/classes-and-templates.4/
</loc>
</url>
<url>
<loc>
https://uorealms.com/realms/articles/categories/player-vs-player.5/
</loc>
</url>
<url>
<loc>
https://uorealms.com/realms/articles/categories/guides.6/
</loc>
</url>
<url>
<loc>
https://uorealms.com/realms/articles/categories/meet-greets.7/
</loc>
</url>
<url>
<loc>
https://uorealms.com/realms/articles/categories/news-reviews-and-interviews.8/
</loc>
</url>
<url>
<loc>
https://uorealms.com/realms/articles/categories/uorealms-bbs.12/
</loc>
</url>
<url>
<loc>
https://uorealms.com/realms/uorealms-store/categories/ultima-merch.1/
</loc>
</url>
<url>
<loc>
https://uorealms.com/realms/uorealms-store/ultima-online-box-art-logo-pin.1/
</loc>
<lastmod>2023-12-05T19:07:34+00:00</lastmod>
</url>
<url>
<loc>
https://uorealms.com/realms/uorealms-store/ultima-online-order-of-the-silver-serpent-emblem-pin.2/
</loc>
<lastmod>2023-12-05T19:20:32+00:00</lastmod>
</url>
<url>
<loc>
https://uorealms.com/realms/uorealms-store/silver-serpent-engraved-ankh-pendant.3/
</loc>
<lastmod>2023-12-06T23:12:10+00:00</lastmod>
</url>
<url>
<loc>
https://uorealms.com/realms/uorealms-store/ultima-v-warriors-of-destiny-box-art-2-enamel-pin.4/
</loc>
<lastmod>2023-12-07T01:19:10+00:00</lastmod>
</url>
<url>
<loc>
https://uorealms.com/realms/uorealms-store/ultima-v-warriors-of-destiny-ultima-avatar-enamel-pin.5/
</loc>
<lastmod>2023-12-07T01:24:22+00:00</lastmod>
</url>
<url>
<loc>
https://uorealms.com/realms/forums/faerham-citadel.2/
</loc>
</url>
<url>
<loc>
https://uorealms.com/realms/forums/announcements.3/
</loc>
</url>
<url>
<loc>
https://uorealms.com/realms/forums/paths-of-virtue.5/
</loc>
</url>
<url>
<loc>https://uorealms.com/realms/forums/roleplay.6/</loc>
</url>
<url>
<loc>
https://uorealms.com/realms/forums/player-run-events.8/
</loc>
</url>
<url>
<loc>
https://uorealms.com/realms/forums/technical-support-third-party-programs.12/
</loc>
</url>
<url>
<loc>
https://uorealms.com/realms/forums/stats-and-skills.15/
</loc>
</url>
<url>

Can anyone shed some light on this for us, please??
 
Errrrrr. That’s usually what an sitemap looks like AFAIK. And normally end users aren’t using a sitemap, but search engines are.
Are you getting this confused with an RSS feed?
As for the error, disable the PING option in the sitemap area of the ACP if you have it enabled. The Google monster prefers to not to notify them with a ping now. They will search/find it at their leisure.
 
Last edited:
Errrrrr. That’s usually what an sitemap looks like AFAIK. And normally end users aren’t using a sitemap, but search engines are.
Are you getting this confused with an RSS feed?

No, just expected it to look different.
As for the error, disable the PING option in the sitemap area of the ACP if you have it enabled. The Google monster prefers to not to notify them with a ping now. They will search/find it at their leisure.

There's no 'ping' option to enable or disable (XF2.2.13) the only PING reference appears in:

1704822282285.webp

but it seems if you remove "ping?" the links do not work -- and I prefer we submit ourselves to the search engines rather than just hope they find us.

Obviously, this is not my area of expertise...

:)
 
but it seems if you remove "ping?" the links do not work -- and I prefer we submit ourselves to the search engines rather than just hope they find us.
That's the point I'm trying to make... neither one of those entries require (nor want) you "submitting" your sitemap to them using the XF process now. Both should be removed and that check box unchecked unless you have other search engine sites that will allow submission by that method then you can place them in there.

 
Top Bottom