-
Hello,
I’ve seen RankMath should work with TranslatePress, but the Site map is empty.
Any ideas about what is going on?
Thank you.
-
Hello,
I’m sorry to hear that you are facing issues with your sitemap while using TranslatePress with Rank Math.
The empty sitemap issue can occur due to various reasons, such as errors in the sitemap source code, caching problems, invalid XML code, or URL format mismatches. When using multilingual plugins like TranslatePress, it’s essential to ensure that translations are complete to avoid empty lines in the sitemap.
To address this problem, you can add a code snippet to your theme’s
rank-math.phpfile. This code snippet helps in filtering out empty URLs from the sitemap. Here is the code you can use:add_filter('rank_math/sitemap/entry', function ($url){ if (isset($url['loc']) && empty($url['loc'])) { return false; } return $url; });By adding this code snippet, you can prevent empty URLs from being included in your sitemap, which should help resolve the issue of the empty sitemap when using TranslatePress with Rank Math.
If you encounter any difficulties implementing this solution or if the issue persists, please let us know so we can assist you further.
Thank you for reaching out.
Sources:
Rank Math Sitemap Issues and Their Fixes » Rank Math
Remove Blank Lines From Sitemaps » Rank Mathok, I’ll try with the snippet, you say I can add it to “your theme’s rank-math.php file”, so you mean I should create this php file into my theme (same folder of functions.php) or I can just add this snippet to my functions.php?
I’ve tried with the snippet in the plugin file rank-math.php and nothing happened (I know this snippet will dissappear with the next update, I was just trying).
Even deactivating other plugins the sitemap is not working.
Hello,
Thank you for contacting us and sorry for any inconvenience that might have been caused due to that.
It looks like you’re currently the Yoast SEO plugin on your website. Could you please try to install the Rank Math plugin again so that we can check the issue further for you?
Looking forward to helping you.
Thank you.
Hello, Rank Math is activated again.
(I installed Yoast SEO and the sitemap worked)I can give access to an email you could provide me or write it in sensive data (if you prefer and it is safe).
Hello,
The issue is with the invalid character on your site title in your website’s database:
Ubicaciones del mapa del sitio – Casa-jard
ínFilouThis issue is occurring because, on your database entries, there are some Unicode characters that are preventing the sitemap from correctly loading.
Please access your WordPress database and check the table wp_options. You’ll notice entries with Unicode characters instead of the correct characters in there.
You can install the PHPMyadmin to access your website’s database.
To be more specific, you may take a look if you find a similar entry like
ínin the option_value column.You can replace the value with the correct character and save the changes.
Let us know how this goes.
Hello Reinelle,
I think it works!
Thank you very much
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 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-postabout 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.
The ticket ‘Sitemap not Working’ is closed to new replies.