Add yearly and monthly sitemap organization for large sites#724
Draft
Add yearly and monthly sitemap organization for large sites#724
Conversation
Co-authored-by: sybrew <7662236+sybrew@users.noreply.github.com>
Co-authored-by: sybrew <7662236+sybrew@users.noreply.github.com>
Co-authored-by: sybrew <7662236+sybrew@users.noreply.github.com>
Co-authored-by: sybrew <7662236+sybrew@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Sitemap for Large sites with filter date/year
Add yearly and monthly sitemap organization for large sites
Jun 25, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR implements a new sitemap feature that organizes content by publication year and month, similar to the approach used by Metro.co.uk. This is particularly beneficial for large sites like news websites that host substantial amounts of historical content.
Key Features
Yearly/Monthly Sitemap Organization:
sitemap.xmlbecomes an index that links to yearly or monthly sitemapssitemap.xml?yyyy=2024show all posts from 2024sitemap.xml?yyyy=2024&m=12show posts from December 2024Benefits:
Implementation Details
Settings & UI:
Backend Changes:
Registry::_init()to capture and sanitize$_GETparametersBase::generate_sitemap()to accept year/month filtering parametersdate_queryfor efficient database queriesbase_2024_12)URL Structure:
Parameter Sanitization:
Developer Features
\The_SEO_Framework\Sitemap\Registry::get_sitemap_parameters()- Gets sanitized year and month parametersthe_seo_framework_sitemap_index_schemas- Filter sitemap index XML schemasTesting
All modified files pass PHP syntax validation. The implementation includes comprehensive parameter sanitization with proper regex patterns and follows WordPress coding standards.
Fixes #649.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.