alleyinteractive / alleyinteractive/wp-seo
Sitemaps: Generate List of Yearly Sitemaps for robots.txt
- Dominant language
- PHP
- Stars
- 45
- Forks
- 13
- Avg merge
- 12d 16h
- Merged PRs (30d)
- 5
Description
### Description
I would like to be able to visit robots.txt on a site running this plugin and see a list of sitemaps broken down by content type and year.
For example:
```
Sitemap: sitemap-posts-2026.xml
Sitemap: sitemap-posts-2025.xml
Sitemap: sitemap-pages-2026.xml
```
Yearly sitemap indexes should be generated for each content type that is enabled in the sitemap feature.
Here is an example query that yields this data along with the most recent modified date for a post in that post type:
```sql
SELECT YEAR(post_date) AS year,
MAX(post_modified) AS last_modified
FROM wp_posts
WHERE post_type = 'post'
AND post_status = 'publish'
GROUP BY YEAR(post_date)
ORDER BY year
```
### Use Case
Search engines should be able to read the list of sitemap indexes per post type and year from robots.txt.
Contributor guide
Assessment
This issue has not been assessed yet.