How to Remove “This xml sitemap is generated by rank math”?

If you are using the Rankmath plugin like I am, you might have noticed the statement/ credit on the XML sitemap generated by it. It contains links pointing to the plugin homepage.

Rankmath Credit

Here's how to remove it:

Create a rank-math.php under the root of your theme.

Add these codes into it:

<?php

/***remove Rankmath statement from Sitemap*****/
add_filter( 'rank_math/sitemap/remove_credit', '__return_true');

Open your XML sitemap in a new web browser to check the result.

Rankmath Sitemap Credit removed.jpg