0

Is there any way to add Dokan stores urls to Rank Math sitemap? (for example make a stores-sitemap.xml included Dokan stores urls)

Thanks a lot Regard

We can add custom urls to Rank Math sitemap by adding following filter to "wp-content/themes/theme-name/rank-math.php". But I need to add stores urls to sitemap dynamically.

<?php
/**
 Filter to add extra URLs to the XML sitemap by type.
 *
 Only runs for the first page, not on all.
 *
 Just replace {$type} with either post or page, in case, if you want the URL to be included in the post or page sitemap respectively.
 *
 @param string $content String content to add, defaults to empty.
 */
add_action( 'rank_math/sitemap/{$type}_content', function() {
return '<url>
<loc>https://rankmath.com/some-custom-url/</loc>
<lastmod>2020-06-10T20:20:20+00:00</lastmod>
</url>';
});
?>
Morteza
  • 1
  • 1

0 Answers0