Rank Math migration site map issue
-
After migrating to Rank Math from Yoast plugin, few links are missing in the sitemap. The links missing are previously added in Yoast by customized code.
Previous code:
function add_custom_feedback_sitemap($sitemap_custom_items)
{
$sitemap_custom_items = ‘
<sitemap>
<loc>https://www.xyz.com/feedback/sitemap-feedback-products.xml</loc>
<lastmod>2020-12-02T08:02:27-05:00</lastmod>
</sitemap>
<sitemap>
<loc>https://www.xyz.com/feedback/sitemap-feedback-posts.xml</loc>
<lastmod>2020-12-02T08:02:27-05:00</lastmod>
</sitemap>’;
return $sitemap_custom_items;
}you please share
// Hook the method to add custom sitemap url
add_filter(‘wpseo_sitemap_index’, ‘add_custom_feedback_sitemap’);I have used rank math hooks like ‘rank_math/sitemap/sitemap_items’, ‘rank_math/sitemap/paths’ and ‘rank_math/sitemap/sitemaps’ but nothing works to add the URLs in rank math sitemap. So, can you please share the valid customized code to add links in sitemap.
- The topic ‘Rank Math migration site map issue’ is closed to new replies.