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!