1

In this page every link has rel="nofollow".

can you guys please tell me how to remove the nofollow from that page.

I am using WordPress them.

Hoping to receive some help from your side

Thanks in advance

Prashant Pimpale
  • 10,349
  • 9
  • 44
  • 84
Zahid Khan
  • 71
  • 9
  • You can create your own feed templates ny following the codex : https://codex.wordpress.org/Customizing_Feeds – Stender Aug 02 '18 at 08:52

2 Answers2

0

To remove nofollow from link please add the below code in your current active theme functions.php file.

The rss hook not allow to change content within tag, so create custom template for your feed.

/**
 * Deal with the custom RSS templates.
 */
function my_custom_rss() {

    if ( 'photos' === get_query_var( 'post_type' ) ) {
        get_template_part( 'feed', 'photos' );
    } else {
        get_template_part( 'feed', 'rss2' );
    }
}
remove_all_actions( 'do_feed_rss2' );
add_action( 'do_feed_rss2', 'my_custom_rss', 10, 1 );

For more help see this link : Click here.

You can get the content of custom feed templates from core wordpress folder /wp-includes/feed-rss2.php

I hope it will help you.

dineshkashera
  • 1,442
  • 1
  • 15
  • 26
  • Hi Dinesh, Thanks for your quick reply, i tried to put the code which was given by you in function.php but it's not helping, do you have any other option i tried installing plugins "Remove nofollow" but still no success – Zahid Khan Aug 03 '18 at 06:11
  • Hello @ZahidKhan i have modified my above answer please see this, and let me know are you able to fix the issue. – dineshkashera Aug 03 '18 at 09:39
  • Still no success – Zahid Khan Aug 03 '18 at 13:02
  • hello @ZahidKhan, i have again modified the answer , hook are not allow to change rss content, so you can create your own feed template. – dineshkashera Aug 03 '18 at 13:54
  • Hello @ZahidKhan, If it helps you as solution then please mark as an answer, so it can help other developers. – dineshkashera Aug 08 '18 at 06:41
0

Take a look at the following code snippet:

global $post;
?>
<?php if ($post->ID == $pageid): ?>
<script type="text/javascript">
$("a").each(function() {
    if ($(this).attr("rel")) {
        $(this).removeAttr("rel");
    }
});
</script>
<?php endif; ?>
Peter
  • 8,776
  • 6
  • 62
  • 95