最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Remove the URL author of post on all comments

programmeradmin0浏览0评论

I can't manage to disable the URL of only the author's post. Here's an example : My website

As you can see, the green link is mine (the author of the post). I only want to remove that link, not other comments links.

How can I do this? I have tried altering this bit of code in functions.php, but it didn't do what I want (it's removing everyone URL, not just mine):

    add_filter( 'get_comment_author_link', 'rv_remove_comment_author_link', 10, 3 );
function rv_remove_comment_author_link( $url, $author, $comment_ID ) {
    return $author;
}

Thanks for your help.

I can't manage to disable the URL of only the author's post. Here's an example : My website

As you can see, the green link is mine (the author of the post). I only want to remove that link, not other comments links.

How can I do this? I have tried altering this bit of code in functions.php, but it didn't do what I want (it's removing everyone URL, not just mine):

    add_filter( 'get_comment_author_link', 'rv_remove_comment_author_link', 10, 3 );
function rv_remove_comment_author_link( $url, $author, $comment_ID ) {
    return $author;
}

Thanks for your help.

Share Improve this question edited Sep 27, 2019 at 15:47 butlerblog 5,1213 gold badges28 silver badges44 bronze badges asked Sep 27, 2019 at 14:22 AdamBAdamB 1 1
  • Perhaps you can do that using CSS display:none. I can take a look, send us a link to one of the posts please. – MistaPrime Commented Sep 27, 2019 at 15:36
Add a comment  | 

2 Answers 2

Reset to default 0

Wordpress have "get_comment_author_url" function to retrieve the url of the author of the current comment.

you can set it to blank using this

function remove_author_url( $url, $id, $commentr ) { 
    return ""; 
}
add_filter( 'get_comment_author_url', 'remove_author_url', 10, 3);

aslam shikalgar you misunderstood. I don't want to get all authors of comment blank. Only the author of the post which he's commenting.

发布评论

评论列表(0)

  1. 暂无评论