alleyinteractive / alleyinteractive/wp-seo
Sitemaps: Generate List of Yearly Sitemaps for robots.txt
- Ngôn ngữ chính
- PHP
- Star
- 45
- Fork
- 13
- Merge trung bình
- 12 ngày 16 giờ
- Pull request đã merge (30 ngày)
- 5
Mô tả
### 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.
Hướng dẫn đóng góp
Đánh giá
Issue này chưa được đánh giá.