wordpress comment website link remove

wordpress comment
wordpress comment

wordpress comment website link remove

wordpress comment
wordpress comment

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

[highlighter]

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
}
endif;
}
add_filter( 'get_comment_author_link', 'dez_remove_post_author_weburl');[highlighter]

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.

Leave a Reply

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

Previous Post

is short tag working in magento 2

Next Post

30 Free Responsive jQuery Image Sliders

Related Posts