Community Forums › Forums › Archived Forums › General Discussion › How to remove all comment authors links?
Tagged: comment link, comments
- This topic has 6 replies, 2 voices, and was last updated 11 years, 11 months ago by
saksham.
-
AuthorPosts
-
December 25, 2013 at 1:44 pm #81189December 25, 2013 at 5:58 pm #81200
nutsandbolts
MemberThis will remove the URL field from your comment form, though it won't help if you need to remove author links in existing comments (let me know if that's the case):
//* Remove comment author link add_filter( 'genesis_comment_form_args', 'url_filtered' ); add_filter( 'comment_form_default_fields', 'url_filtered' ); function url_filtered( $fields ) { if ( isset( $fields['url'] ) ) unset( $fields['url'] ); if ( isset( $fields['fields']['url'] ) ) unset( $fields['fields']['url'] ); return $fields; }
Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
I provide development and training services for designers • Find me on Twitter and Google+December 26, 2013 at 3:16 am #81226saksham
MemberI want to remove links from existing comments too.
December 26, 2013 at 7:21 pm #81338nutsandbolts
MemberIf you don't have very many existing comments, it may be easiest to go through each one and edit to remove the URL. If that's too time consuming, you can get rid of them all via phpMyAdmin - just PLEASE make a backup before touching your database since it could break your entire site. If you aren't familiar with MySQL, I urge you to seek help with this.
Disclaimers aside, executing this command in MySQL will remove all author URLs in existing comments:
update wp_comments set comment_author_url = '';
Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
I provide development and training services for designers • Find me on Twitter and Google+December 28, 2013 at 1:27 pm #81627saksham
MemberHello, is there a way to make my previous code work if possible which removes the URLs dynamically i.e. it doesn't show them in my blog post but they can still be seen in admin panel. I'm not sure why the below code doesn't work with News Pro. It works with my other Genesis child theme.
function author_link(){
global $comment;
$comment_ID = $comment->user_id;
$author = get_comment_author( $comment_ID );
$url = get_comment_author_url( $comment_ID );
if ( empty( $url ) || ‘http://’ == $url )
$return = $author;
else
$return = “$author”;
return $return;
}
add_filter(‘get_comment_author_link’, ‘author_link’);I am sorry if I'm asking for too much. 😉
December 28, 2013 at 7:24 pm #81718nutsandbolts
MemberThere has to be a difference between the way comments are called in the HTML5 child themes versus the XHTML themes. I would start here - this is the best reference for Genesis 2.0 I've ever seen: http://docs.garyjones.co.uk/genesis/2.0.0/package-Genesis.Comments.html
Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
I provide development and training services for designers • Find me on Twitter and Google+December 29, 2013 at 12:31 pm #81860saksham
MemberWell you are right. Anyways, I ran the SQL query and removed all author links instead.
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.