-
-
Notifications
You must be signed in to change notification settings - Fork 6
Description
While discussing the support for this plugin inside the forum plugin, @bennothommo was skeptical about the need to add all the topics urls, due to the true fact that it can make the sitemap go bigger than accepted by the search bots.
The Google's sitemap guidelines says that a sitemap should not include more than 50k links and be smaller than 50Mb.
Beyond this limits, the main sitemap file should be a sitemap index which refers nested sitemaps.
As of today, the plugin just cut the sitemap to 50k links:
wn-sitemap-plugin/models/Definition.php
Line 19 in ee1d77b
| const MAX_URLS = 50000; |
wn-sitemap-plugin/models/Definition.php
Lines 207 to 211 in ee1d77b
| protected function makeUrlElement($xml, $pageUrl, $lastModified, $frequency, $priority) | |
| { | |
| if ($this->urlCount >= self::MAX_URLS) { | |
| return false; | |
| } |
To solve this without adding any limitation, the sitemap plugin should handle nested sitemaps.
Because controlling the sitemap file size any time the search bot renders to optimize it would be difficult, what I suggest here is to let the website's admin decide how the sitemap should be cut.
How I see this feature is:
- Add a
Sectionmodel, with a name and a slug - Add a 1:1 relation between
DefinitionandSectionand the corresponding relation field in the creation a linkDefinitionform - Generates multiple files when the
Definitionlinks limits goes beyond the 50k limit (ie: blogposts_1.xml, blogposts_2.xml, ...)
If no Section model is defined, the plugin would just continue to work as of today.
But if one Section model is defined, the sitemap.xml file would look like this:
<sitemapindex>
<sitemap>
<!-- Refers links without Section model attached -->
<loc>https://example.com/sitemaps/default.xml</loc>
</sitemap>
<sitemap>
<loc>https://example.com/sitemaps/blogposts_1.xml</loc>
</sitemap>
<sitemap>
<loc>https://example.com/sitemaps/blogposts_2.xml</loc>
</sitemap>
<sitemap>
<loc>https://example.com/sitemaps/blogposts_3.xml</loc>
</sitemap>
</sitemapindex>Metadata
Metadata
Assignees
Type
Projects
Status