How to Remove RankMath Credit from Sitemap

By WebCare in September 9, 2025 – Reading time 2 minute

If you’re using the Rank Math SEO plugin, your WordPress sitemap (/sitemap_index.xml) includes a stylesheet link and a credit line pointing back to Rank Math.

While harmless, some site owners prefer a clean, raw XML sitemap without extra branding. Here’s how to remove the Rank Math credit and stylesheet in just a few lines of code.

RankMath Credit is Unncessary

remove rankmath sitemap credit

If you’ve paid for RankMath Pro, it makes very little sense to show RankMath branding on the Sitemap. It serves no purpose to us (paying customers) and only benefits RankMath commercially.

By default, Rank Math adds two extras to your sitemap:

  • An XSL stylesheet link
  • A “generated by Rank Math” credit

You can remove both with a simple snippet.

// Disable Rank Math sitemap XSL and credit
add_filter( 'rank_math/sitemap/xsl', '__return_false' );
add_filter( 'rank_math/sitemap/remove_credit', '__return_true' );

Add this code to your theme’s functions.php or a custom rank-math.php file in your theme folder.

After saving, go to Settings → Permalinks and hit Save, then purge any caches. Your /sitemap_index.xml will now display clean, raw XML without Rank Math branding.

Search engines don’t care about the stylesheet or credit, so removing them won’t affect SEO.

The Result: Clean RankMath Credit

cleaner remove rankmath sitemap credit

Now your sitemap looks so much cleaner without RankMath Credit.

Recap on How to Remove RankMath Credit

The easiest way (without going through settings) to remove RankMath Credits

  1. Copy and paste snippet
  2. Resave the Permalink
  3. Clear cache

It should take you 3-4 minutes at most.

You Made It to the End!🔥
Free Tips in Your Inbox
Get the latest, evergreen tips to secure, quicken and improve your WordPress in our weekly newsletter.
No spam policy, pure value tips/ tricks
Subscription Form

Written by

Edwin Masripan is the Lead Developer at WebCare with nearly 20 years experience in WordPress web development. He was a speaker at WordCamp (WordPress gathering).
https://webcare.co