Hello,
Thank you for contacting Rank Math and sorry for any inconvenience that might have been caused due to that.
We are checking this problem and we will be in touch in a short while.
Looking forward to helping you. Thank you.
Hi Roland,
Thanks for getting in touch with us.
Please add at least one non-home page to your website without the noindex tag so that the page sitemap works. You only have one page indexable and that is your homepage which is why the sitemap isn’t finding any indexable non-home page to include in the page-sitemap.xml
file.
In the meantime, we are noting this down for improvement.
Please do not hesitate to let us know if you need our assistance with anything else.
Dear Todd,
Maybe later I would like to made a blog and some post, but now I only would like use my home page, without any other non-home page. The sitemap MUST contain the home page, even though there are no other subpage, so please privide a solution or an update.
I tried two other XML sitemap generator they included the homepage, but the noindex pages also:
https://wordpress.org/plugins/google-sitemap-generator/
https://wordpress.org/plugins/xml-sitemap-feed/
Can this caused by your plugin too?
Hi Roland,
Please use this code in your theme’s functions.php file:
add_action( 'rank_math/sitemap/page_content', function() {
return '<url>
<loc>https://your-home-page.com/</loc>
<lastmod>2020-03-07T18:02:24+00:00</lastmod>
</url>';
});
That should do the trick.
Let me know if it doesn’t work.
Hello,
Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.
If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.
Thank you.