Site logo

[Support request] Internal links nofollow

Home Forums Support [Support request] Internal links nofollow

Home Forums Support Internal links nofollow

Viewing 15 posts - 16 through 30 (of 32 total)
  • Author
    Posts
  • #2123246
    mad2toi

    Thank you for your feedback but it does not work with the theme. I need something custom

    #2123494
    Leo
    Staff
    Customer Support

    but it does not work with the theme. I need something custom

    I can’t see how this would be a theme-related question.

    Did you find a solution that works in a Twenty series WP theme environment?

    If so the exact same solution should work in GeneratePress.

    If you haven’t found a solution yet then I’d recommend checking with WP’s support team on this.

    #2123553
    mad2toi

    Hi yes this code :

    add_action( ‘wp_footer’, ‘twentytwentyone_add_ie_class’ );

    function dofollow($url) {
    $url = str_replace(‘ nofollow’, ”, $url);
    return $url;
    }
    add_filter(‘get_comment_author_link’, ‘dofollow’);

    But remplace twentytwentyone by ?

    Can you solve it please ?

    #2123586
    Leo
    Staff
    Customer Support

    I don’t think that line does anything.

    Have you tried Fernando’s solution here?
    https://generatepress.com/forums/topic/internal-links-nofollow/#post-2120444

    #2123632
    mad2toi

    Hello, I have already tried but it does not work. Do you have a custom code please?

    https://ibb.co/kGmqGdy

    #2123657
    Elvin
    Staff
    Customer Support

    Hi there,

    Can you share how you’re running the code/s provided? It’s possible the issue is w/ the codes not executing at all.

    Let us know.

    #2123662
    mad2toi
    #2123666
    Elvin
    Staff
    Customer Support

    I’ve tested all the variations of the code provided and they all worked but to different degrees.

    Can you specific which links do you want to specifically change the rel attribute to dofollow?

    Is it only for the comment links? Or ALL the links on the site?

    Let us know.

    reminder: For PHP snippets, please a child theme’s functions.php for a Code Snippets plugin for running PHP codes. Using the Parent theme’s functions.php has a risk of your codes being wiped if you update the theme. Here’s our recommended way of adding PHP – https://docs.generatepress.com/article/adding-php/

    #2123675
    mad2toi

    Thank you for your reply. I have internal nofollow link errors in my web pages.

    https://ibb.co/5xPgNH3

    #2123685
    Elvin
    Staff
    Customer Support

    To investigate further:

    Can you link us to the specific page where this audit was done? I’ll check the entire page if there are any other link with nofollow aside from the comments.

    As for the comments:

    Try this PHP snippet:

    add_filter( 'get_comment_author_link', 'remove_nofollow_on_comment_links', 20, 3 );
    
    function remove_nofollow_on_comment_links( $return, $author, $comment_ID ){
    	$comment = get_comment( $comment_ID );
    	$url     = get_comment_author_url( $comment );
    	$return = '<a href="'.$url.'" rel="external ugc" class"url">'.$author.'</a>';
    	
    	return $return;
    }
    #2123686
    mad2toi

    The code worked perfect and thank you 🙂 The audited site is madintouch.com

    #2123716
    mad2toi

    The code works but creates a conflict on my site. Do you know how to solve the problem?

    https://ibb.co/THdkCTV

    #2123723
    Elvin
    Staff
    Customer Support

    The code itself literally just removes nofollow from the rel attribute.

    These reports are completely unrelated to the code.

    Reading some of the text on the image, the context is SEO related. (semantics)

    #2123726
    mad2toi

    Do you know how to solve the problem please ?

    #2123729
    Elvin
    Staff
    Customer Support

    Do you know how to solve the problem please ?

    You’ll need an SEO plugin for this. 🙂

    But as for the actual functionality of the specific SEO plugin you’ll be using, we suggest talking to its support for best practices. 🙂

Viewing 15 posts - 16 through 30 (of 32 total)
  • You must be logged in to reply to this topic.