• Resolved jhmattern

    (@jhmattern)


    I was wondering how I can make all bio links nofollow (not the social media links, but links added in the profiles themselves). We have html enabled for them, so contributors are able to add links directly. This is mostly for their forum profiles, but authors have the same bio pulled into the author bio box.

    I was able to make them no-follow automatically on the author pages through my theme templates. But I can’t figure out how to do the same in your plugin, and that’s even more important.

    Any tips or suggestions?

    Thanks!

    https://www.ads-software.com/plugins/fancier-author-box/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Slobodan Manic

    (@slobodanmanic)

    Not automatically, no. Besides, this really is not an issue with our plugin, what you’re trying to do is automatically make all WordPress user bio links nofollow, regardless of where that bio is shown.

    You can make those links nofollow when you add them to the bio, so maybe that’s the way to go.

    Thread Starter jhmattern

    (@jhmattern)

    Adding them manually when the links are added to a bio isn’t an option. We have thousands of member accounts, each with its own bio. And authors can change their bios on their own. So even if I add the nofollow attribute, there is nothing to stop them from removing it.

    From everything I’ve found about this, it appears the only way to do it is to use a string replace wherever the bios are called to be displayed.

    I’m able to figure out how to do this everywhere else in my WordPress installation other than your author bios. They’re being called differently, and I haven’t been able to figure out the right adjustments to the code.

    This is incredibly important now, especially with the news this week of Google cracking down harder on guest posts done for links. Blog owners need the option to make these bio links nofollow by default.

    Let me give you an example of how I did this on our author pages. Hopefully you’ll have an idea on how I can tweak it to work with your code.

    Here’s what works on the author pages:

    <?php
    $the_author_description = get_the_author_meta('description');
    $string = str_replace('href','rel="nofollow" target="_blank" href', $the_author_description);
    echo $string;
    ?>

    In your plugin files, I’m assuming what I need to change is somewhere in here in ts-fab-construct-tabs.php:

    if( get_user_meta( $author->ID, 'ts_fab_position', true) ) {
    				$ts_fab_bio .= '<div class="ts-fab-description"><span>' . get_user_meta( $author->ID, 'ts_fab_position', true) . '</span>';
    
    				if( get_user_meta( $author->ID, 'ts_fab_company', true) ) {
    					if( get_user_meta( $author->ID, 'ts_fab_company_url', true) ) {
    						$ts_fab_bio .= ' ' . __( 'at', 'ts-fab' ) . ' <a href="' . esc_url( get_user_meta( $author->ID, 'ts_fab_company_url', true) ) . '" rel="nofollow">';
    							$ts_fab_bio .= '<span>' . get_user_meta( $author->ID, 'ts_fab_company', true) . '</span>';
    						$ts_fab_bio .= '</a>';
    					} else {
    						$ts_fab_bio .= ' ' . __( 'at', 'ts-fab' ) . ' <span>' . get_user_meta( $author->ID, 'ts_fab_company', true) . '</span>';
    					}
    				}
    
    				$ts_fab_bio .= '</div>';
    			}
    
    			$ts_fab_bio .= '</div><!-- /.ts-fab-header -->
    			<div class="ts-fab-content">' . $author->user_description . '</div>
    		</div>
    	</div>';
    
    	return $ts_fab_bio;
    
    }

    I don’t mind having to add the plugin to my manual update list if there’s a way I can get this working. I love your plugin, but I need to find a way to make it work with the guest post policies or I have to go back to the default author bios. If you have any suggestions of where the string replace might work in here, please let us know. In the meantime I’ll tinker a bit more. If I figure it out, I’ll come back and post whatever I find in case anyone else is having this issue.

    Thanks!

    Plugin Author Slobodan Manic

    (@slobodanmanic)

    Hi,

    I completely understand the situation, believe me. However, we can’t do this for all plugin users, and I hope our reasoning will make sense to you.

    Our plugin simply displays what is stored in the bio field. If we make the links nofollow for everyone, we’re causing a problem for those who don’t want nofollow. This way, plugin displays whatever you store in user bio field, and it’s better to set nofollow there.

    Like I said, I understand your situation 100%. So, in that second block of code replace:

    $author->user_description

    with

    str_replace('href','rel="nofollow" target="_blank" href', $author->user_description)

    And you should be good. This does the same thing you do in author pages, it’s just different variable that we’re using.

    Sorry you had to go through this, but at least there’s a workaround for you.

    P.S. We REALLY appreciate users like you and I’m glad you find our plugin useful.

    Thread Starter jhmattern

    (@jhmattern)

    Okay. My main dev was able to take a look and figure it out. Here’s the solution for anyone else who wants to do the same.

    Replace this:

    $ts_fab_bio .= '</div><!-- /.ts-fab-header -->
    			<div class="ts-fab-content">' . $author->user_description . '</div>

    With:

    $ts_fab_bio .= '</div><!-- /.ts-fab-header -->
    			<div class="ts-fab-content">' . str_replace('href','rel="nofollow" href',$author->user_description) . '</div>

    That’s in ts-fab-construct-tabs.php in the plugin includes folder.

    Thread Starter jhmattern

    (@jhmattern)

    Thanks! Sorry. Our posts overlapped. ?? I appreciate you looking it!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Make links within bio text rel=nofollow’ is closed to new replies.