-
Hi Team,
I am getting an error when submitting my sitemap to search console all of a sudden.
This is the sitemap: https://www.iwantcheats.net/post-sitemap.xml
Error is:
This is not a valid URL. Please correct it and resubmit.
Examples
URL:
Line 4
Parent tag:
url
Tag:
loc
-
Hello,
Thank you for contacting Rank Math, and sorry for any inconvenience caused.
Please add this filter to your website:
add_filter('rank_math/sitemap/entry', function ($url){ if (isset($url['loc']) && empty($url['loc'])) { return false; } return $url; });Then, exclude the sitemaps from caching by following this guide:
https://rankmath.com/kb/exclude-sitemaps-from-caching/Once done, clear your website cache and resubmit the sitemap.
Hope this helps.
We look forward to helping you.
Hi There,
Thanks for your response,
I have added the PHP code snippet as well as the lines of code to exclude the sitemap from the cache on WP Rocket but the error is still happening. Followed all the steps above.
The error is on line 4 as you can see on the sitemap above:
<url>
<loc></loc>
</url>Hello,
We might need to take a closer look at the settings. Please edit the first post on this ticket and include your WordPress & FTP logins in the designated Sensitive Data section.
Please do take a complete backup of your website before sharing the information with us.
It is completely secure and only our support staff has access to that section. If you want, you can use the below plugin to generate a temporary login URL to your website and share that with us instead:
https://wordpress.org/plugins/temporary-login-without-password/
You can use the above plugin in conjunction with the WP Security Audit Log to monitor what changes our staff might make on your website (if any):
https://wordpress.org/plugins/wp-security-audit-log/
Looking forward to helping you.
Thank you.
Hello,
I have updated the sensitive data as requested. Can you please check further?
Thank you.
Hello,
Thank you for providing the WordPress admin login and I was able to replicate the issue on our end.
We noticed that you are currently using an older version of Rank Math and your current PHP version is not recommended for our latest update. We need to check if updating the plugin will resolve the issue.
Kindly contact your hosting provider, upgrade your PHP version and update our plugin. See if this will resolve the issue.
If not, please share your FTP login in the sensitive data section so we can deeply debug the issue.
Looking forward to helping you.
Hi There,
We updated the PHP version as well as the RankMath plugin,
The problem still seems to be happening.
Can you please have another look for us?
Hello,
I apologize for the delay in responding.
I can see that you didn’t select any post archive on your site and as it’s missing on your site, sitemap can’t get the post archive URL that it generally adds at the top of the post-sitemap.
In order to fix this issue, please try setting a post archive from WordPress Dashboard > Reading > Your homepage displays > Posts page.
Once done, please try clearing your site cache and check the source code of your post-sitemap again to see if the issue is resolved.
Let us know how it goes. Looking forward to helping you.
Thank you.
Hi There,
I did what you mentioned above although we don’t require a page there. But still the same problem.
I tried also to remove the snippet you gave earlier on but still source code shows the same issue with the post sitemap.
Any ideas why this is happening?
Thanks for your help
It’s actually working now! Thank you
Hello,
We are super happy that this resolved your issue. If you have any other questions in the future, know that we are here to help you.
If you don’t mind me 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 do 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.
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.
The ticket ‘Sitemap Error’ is closed to new replies.