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
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 functions.php file to remove the
Navigating to these files is different for classic theme users and block theme users. For those with the classic themes, go to WordPress Dashboard > Appearance > Theme File Editor.
functions.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.
If you are using a block theme, then navigate to WordPress Dashboard > Tools > Theme File Editor.
functions.php from theme files as shown below:
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
sponsored options for outbound links to be useless:
We offer other options for links at WordPress Dashboard > Rank Math > 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.