Remove no-follow links from theme with JavaScript

How might I use JavaScript to remove the nofollow attribute from this page and others like it:

I've gotten this far but am unsure how to implement it:

<div class="job_listing-url">
<span itemprop="url"></span>

My best try:
$( '.job_listing-url' ).find( 'a' ).attr( 'rel', '' );

  • Sajid

    Hello Brennen Bliss,
    Hope you are doing good today :slight_smile:

    Try using the following code to remove rel attribute from all links throughout your website.

    function wpmudev_remove_rel_attribute(){?>
    	<script type="text/javascript">
    <?php }
    add_action('wp_footer', 'wpmudev_remove_rel_attribute', 99);

    Add this code in functions.php file of your child theme or use it as mu-plugin.

    If you go with mu-plugin route then, go to your /wp-content/ folder via FTP, and find the folder called "mu-plugins". If there is no folder with that name, then you'll want to create one. Then, create a file inside that folder, and give the file any name you like and paste the code in there.

    You don't need to activate that plugin, as it will be always be automatically activated. Please be sure to add a PHP start tag at the beginning of the code if you insert this code as a mu-plugin, like this:


    Take care and have a nice day :slight_smile:

    Best Regards,

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.