Hello,
Thank you for contacting Rank Math and bringing your concern to our attention. Iβm sorry for any inconvenience this issue may have caused you.
For initial troubleshooting, please make sure that your sitemap is not getting cached. Please follow these steps:
1. Ensure youβre using the latest version of your plugins/theme including the Rank Math plugin.
2. Flush the Sitemap cache by following this video screencast:
https://i.rankmath.com/xXXhDt
3. Exclude the Sitemap files of the Rank Math plugin in your caching plugin. The cache could be via a plugin or from the server:
https://rankmath.com/kb/exclude-sitemaps-from-caching/
Also, please ensure that your Author pages are not set to No Index
since No Index pages are not included in the sitemaps.
You can check this on your WordPress admin area > Rank Math > Titles & Meta > Authors > Author Robots Meta.
Or, you can also check the individual author pages and ensure that they are set to Index.
Here’s a link for more information:
https://rankmath.com/kb/url-not-in-sitemap/
If the issue still persists, please share the author URL so we can check as well. You can add it in the sensitive data section.
I hope that helps.
Thank you.
Hello,
I have updated the sensitive data as requested. Can you please check further?
Thank you.
Hi Reinelle,
I tried all your solution but it doesn’t seem to be effective.
I also tried to change a post author, and with that, the new user is now present in the sitemap.
So it seems that only user with a post are present in the sitemap.
I updated the post with data to help you.
Thank you in advance π
Hello,
To be included in the sitemap, the author must have at least one published post. If there are no posts for an author’s archive then it will not be included in the sitemap. However, you can use the following filter to manually add the URLs in your author sitemap: https://rankmath.com/kb/filters-hooks-api-developer/#add-extra-urls-in-sitemap
Hope this helps. Let us know if you need any other assistance.
Hi,
I already think about this solution. For the moment, it can help, but later, I’ll have dozens of users on my website, and I won’t be able to easily managed the author sitemap..
Don’t you have any filter to allow user with no post to be added in the sitemap ?
I check here: https://rankmath.com/kb/filters-hooks-api-developer/#sitemap-user-query and you use:
$args['role__not_in']
Is there a $args['without_post'] = true
maybe ?
Thank you
Hello,
Could you please try the following filter to include the authors without any posts in the sitemap?
add_filter( 'rank_math/sitemap/author/query', function( $args ) {
$args['has_published_posts'] = null;
return $args;
} );
After applying the filter please make sure that you flush the sitemap by following the steps here: https://i.rankmath.com/pipRDp
Hope this helps solve your issues.
Don’t hesitate to get in touch if you have any other questions.
Hi Miguel,
This is it, this is what I was looking for
Thank you for this piece of code it’s solved my problem π
Hello,
We are super happy that we have addressed your concern. If you have any other questions in the future, know that we are here to help you.
If you don’t mind us asking, could you please leave us a review (if you haven’t already) on https://wordpress.org/support/plugin/seo-by-rank-math/reviews/#new-post about your overall experience with Rank Math? We appreciate your time and patience.
If you have another question in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.
Thank you.