Hello Brad,
Thank you for getting in touch.
You don’t need a separate Sitemap for a translated language. Your multi language plugin adds an hreflang
tag to your posts which help Google determine that a piece of content is a translation of another post/page.
Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.
Hi Todd
Thanks for your response. Regardless of the hreflang tag, which I understand how that works, I have seperate sites for seperate countries which may or may not have different content per site. Not everything needs to be the same on every site.
So the point is, RM does not pick up nor generate ANY content from the other Multi Domains from PolyLang.
In a standard polylang setup where langs are in subdirectories, this is not a problem.
I have not even started talking about the other multilingual issues.
Furthermore, you should know that google treats each website as its own. So it would make logical sense to publish a site map per site.
Hi Brad,
Thanks for the follow up.
You can extend the Rank Math functionality by making use of the following filter to add URLs from the other languages to the sitemap:
/**
* Filter to add extra URLs to the XML sitemap by type.
*
* Only runs for the first page, not on all.
*
* @param string $content String content to add, defaults to empty.
*/
add_action( 'rank_math/sitemap/{$type}_content', function() {
});
function rank_math_add_custom_dynamic_url( $urls ) {
$urls .= '
http://www.mysite.com/dynamic-category1/
2019-02-22T18:02:24+00:00
';
$urls .= '
http://www.mysite.com/dynamic-category2/
2019-02-22T18:02:24+00:00
';
return $urls;
}
I hope this info helps. 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.