Troubleshooting SEOPress XML Sitemaps: Why Posts Are Missing and How to Fix It
Content
If you're using the 'SEOPress – On-site SEO' plugin and find that your posts, pages, or custom post types are not appearing in your XML sitemap, you're not alone. This is a common issue with a few potential causes and solutions. This guide will walk you through the most effective troubleshooting steps.
Why This Happens
Based on community reports and solutions from the 'SEOPress – On-site SEO' team, content can be excluded from the sitemap for several key reasons:
- Indexing Status: The post or page is set to 'noindex' in its meta settings.
- Canonical URLs: A custom canonical URL is set that differs from the post's actual permalink.
- Pagination Limits: The plugin defaults to showing the most recent 1000 items for performance. Older content may be in a separate, paginated sitemap.
- Rewrite Rules: Permalink structures, especially after migration or creating new post types, can become outdated and need to be refreshed.
- Empty Terms: For taxonomy sitemaps, terms with no associated published content are automatically excluded.
How to Fix Missing Posts in Your Sitemap
1. Check the Indexing and Canonical Settings
The first and most crucial step is to verify the SEO settings on the affected posts or pages.
- Edit the post or page in question.
- Locate the SEOPress meta box (usually below the content editor).
- Navigate to the 'Advanced' tab.
- Ensure the 'Index this page' option is set to 'Yes'.
- Ensure the 'Canonical URL' field is empty unless the canonical URL is intentionally different from the permalink. A custom canonical that matches the permalink can cause the post to be omitted.
2. Flush Your Permalinks
This is a common fix, especially after migrating from another SEO plugin like Rank Math or Yoast, or after registering new custom post types.
- Go to Settings > Permalinks in your WordPress admin dashboard.
- Simply click the 'Save Changes' button without making any modifications.
- This action refreshes the rewrite rules and often resolves sitemap display issues instantly.
3. Understand Sitemap Pagination
By default, SEOPress limits sitemaps to 1000 entries per paginated sitemap to prevent server timeouts. If you have more than 1000 posts, they will be split across multiple sitemap files (e.g., post-sitemap1.xml, post-sitemap2.xml). Check your main sitemap index (sitemaps.xml) to see if there are multiple sitemap files listed for your post type.
4. Verify Custom Post Type and Taxonomy Settings
For custom post types (CPTs) and taxonomies, double-check two places in the SEOPress settings:
- Titles & Metas: Go to SEOPress > Titles & Metas. Select the 'Post Types' tab. Ensure your CPT is set to 'yes' for 'In Sitemap?'.
- XML Sitemaps: Go to SEOPress > XML / HTML Sitemap. Under the 'Post Types' section, ensure the checkbox for your custom post type is selected.
- For taxonomies, ensure the terms have at least one published post associated with them, as empty terms are not included.
5. Check for Caching Conflicts
Sitemaps should not be cached, as they need to update immediately when new content is published. If you are using a caching plugin or server-level caching, ensure that your sitemap URLs (typically */sitemaps.xml and */post-sitemap*.xml) are added to an exclusion list. Consult your caching plugin's documentation for instructions on excluding specific URLs.
When to Use a Custom Hook (Advanced)
If the above steps don't resolve your issue, you may need to use a custom code hook. The 'SEOPress – On-site SEO' team provides several filters for advanced control.
Example: Changing the 1000-Post Limit
To change the number of posts per sitemap, you can add a filter to your theme's functions.php file. Note: Increasing this number significantly can cause server timeouts on large sites.
add_filter('seopress_sitemaps_max_posts_per_sitemap', 'sp_sitemaps_max_posts_per_sitemap');
function sp_sitemaps_max_posts_per_sitemap() {
return 500; // Change 500 to your desired number
}
For more complex queries, such as excluding specific terms, the 'SEOPress – On-site SEO' team suggests using the correct filter, like seopress_sitemaps_single_term_query.
Conclusion
Missing content in your SEOPress sitemap is typically resolved by checking the indexing status, flushing permalinks, or understanding the built-in pagination. For most users, the first three steps will solve the problem. If you continue to experience issues, reviewing the official documentation for hooks may provide a more tailored solution.
Related Support Threads Support
-
Custom Post Type Pages Not Showing in XML Sitemaphttps://wordpress.org/support/topic/custom-post-type-pages-not-showing-in-xml-sitemap/
-
Suggestion for a better setuphttps://wordpress.org/support/topic/suggestion-for-a-better-setup/
-
Static sitemap?https://wordpress.org/support/topic/static-sitemap/
-
XML Posts sitemap generation is very slowhttps://wordpress.org/support/topic/xml-posts-sitemap-generation-is-very-slow/
-
sitemap questionhttps://wordpress.org/support/topic/sitemap-question-12/
-
Changed the sitemap limithttps://wordpress.org/support/topic/changed-the-sitemap-limit/
-
Page in multiple sitemapshttps://wordpress.org/support/topic/page-in-multiple-sitemaps/
-
Limiting the sitemap by datehttps://wordpress.org/support/topic/limiting-the-sitemap-by-date/
-
Home Page Display on Post Sitemaphttps://wordpress.org/support/topic/home-page-display-on-post-sitemap/
-
Description character limithttps://wordpress.org/support/topic/description-character-limit/
-
Posts sitemap is emptyhttps://wordpress.org/support/topic/sitemap-is-empty-3/
-
question about sitemaphttps://wordpress.org/support/topic/question-about-sitemap/
-
Custom Post type pages are not in sitemaphttps://wordpress.org/support/topic/custom-post-type-pages-are-not-in-sitemap/
-
No limit for sameAs optionhttps://wordpress.org/support/topic/no-limit-for-sameas-option/
-
SEOPRESS IS NOT SHOWING ALL MY SITEMAPShttps://wordpress.org/support/topic/seopress-is-not-showing-all-my-sitemaps/
-
HTML Sitemap – can’t really use ithttps://wordpress.org/support/topic/html-sitemap-cant-really-use-it/
-
Sitemaps Too Slowhttps://wordpress.org/support/topic/sitemaps-too-slow/
-
Sitemap taxonomy isn’t completehttps://wordpress.org/support/topic/sitemap-taxonomy-isnt-complete/
-
max products on one pagehttps://wordpress.org/support/topic/max-products-on-one-page/
-
order sitemaphttps://wordpress.org/support/topic/order-sitemap/
-
Unregistered custom post type still presents in Sitemaphttps://wordpress.org/support/topic/unregistered-custom-post-type-still-presents-in-sitemap/
-
Sitemap Post Limithttps://wordpress.org/support/topic/sitemap-post-limit/
-
Exclude elements from sitemapshttps://wordpress.org/support/topic/exclude-elements-from-sitemaps/
-
Sitemap not showing more than 20 postshttps://wordpress.org/support/topic/sitemap-not-showing-more-than-20-posts/