🌞 Summer Sale DISCOUNT!


Remove “rank-math-link” Class from All Outbound Links

In this tutorial, we’re going to walk through the steps on how to remove the Rank Math link class from the outbound links.

In the Rank Math plugin, we overwrite Gutenberg’s link module to add nofollow & sponsored attributes. The rank-math-link is a unique class that is needed to overwrite the default module.

However, you can paste the following code in your theme’s rank-math.php file to remove the rank-math-link class.

Navigate to WordPress Dashboard → Appearance → Theme File Editor (for Classic Theme) or WordPress Dashboard → Tools → Theme File Editor (for Block Theme).

Navigate to Theme File Editor

Now click rank-math.php from theme files. Make sure that you are editing the child theme so as to ensure the safety and smooth running of the website.

Navigate to rank-math.php

Now use the below-shown code snippet to add and then click Update File to reflect the changes.

 * Filter to remove `rank-math-link` class from the frontend content links
add_filter( 'rank_math/link/remove_class', '__return_true' );

Doing this will essentially render the nofollow and sponsored options for outbound links to be useless:

nofollow and sponsored option

We offer other options for links at WordPress Dashboard → Rank Math SEO → General Settings → Links as well. You can read more about each setting in our General Settings guide. If you still have any questions, please feel free to contact our support team who are available 24×7 and will help you out as soon as possible.

Still not using Rank Math?

Setup takes less than 5 minutes including the import from your old SEO Plugin!

Learn more about the PRO Version

Still need help?


Submit Your Question

Please give us the details, our support team will get back to you.

Open Ticket

Related Articles