Home » WordPress Tutorials » You are reading »

How to Remove Post Author Website Url Link in Comments

Today i am doing some checking and index updates in Google Webmaster Tools, to my surprise, there’s tons of links coming from my own site homepage url (dezzain.com) in one of my most active post – Mesocolumn WP Theme. Doing some checking and research and found out that all the links came from my own comments and reply to support thread. It is the Author Comment Website URL. Although comments website link suppose to be ‘no-follow’ but not sure if this harmful to site SEO and since i am using schema data structure on posts and comments, i really do not want any repeated links from my own homepage url.

I’m fine with other users leave their website url in comments but i would like to remove my own (Post Author) website url in comments. One of the easiest way would be go to dashboard->edit profile and remove my own website url but that’s not what i want. Continue doing some search on Google, i found a WordPress Plugin that can solved this – Disable Author and Comments Link but it does not meet my requirement since i’m still prefer commenters to leave their website url if they wanted to.

In this article, i will teach you How to Remove Post Author Website Url in Comments without WordPress Plugin, just using the WordPress core add_filter().

You just need to add this PHP Code Snippet into your functions.php

function dez_remove_post_author_weburl($return) {
global $comment, $post;
if( !is_admin() ): //only run outside dashboard  
if ( $comment->user_id == $post->post_author ) {
$author = get_comment_author( get_comment_ID() );
$return = $author; //return post author display name only
return $return;
} else {
return $return; //return default
add_filter( 'get_comment_author_link', 'dez_remove_post_author_weburl');

That’s it, i used is_admin() check to make sure the function run outside dashboard only since we still need all the default core link when editing the comments.

Hope you found this WordPress tips and tutorial useful.

Related Topics:

WordPress Tutorials
Building Your Website with WordPress? Learn How to Optimize it
WordPress Tutorials
How to Detect Mobile or Tablet Condition in WordPress
WordPress Tutorials
Designing and Protecting Your WordPress Site is Easier Than You Think
WordPress Tutorials
The Ultimate SEO Tips For Your WordPress Blog
How to Remove Post Author Website Url Link in Commentshttp://cdn.dezzain.com/1/2013/07/remove-post-author-link.jpghttp://cdn.dezzain.com/1/2013/07/remove-post-author-link-150x150.jpgRichie KS WordPress Tutorialscomments filter,comments hacks,wordpress codingLearn How to Remove Post Author Website Url Link in Comments to prevent repeated links from your own website URL. DEZZAIN.COM
Enjoy This Article?, Follow us or Share it smiley
viral and buzz WordPress theme

24 Comments Already

  1. ThankYou it worked…
    finally your technique worked to me..

    Public CommentUserThankYou it worked... finally your technique worked to me..
  2. i need this wordpress plugin, please send thos in mail.

    Public CommentUseri need this wordpress plugin, please send thos in mail.
1 3 4 5

Write a Reply or Comment

Your email address will not be published. Required fields are marked *

You can wrap php, js or style css code with [PHP]..your code...[/PHP]