Remove the HTML Tags and Attributes from Comments Box in Genesis Child Theme

By default in Genesis Child theme and general WordPress themes, html tags and attributes in the Comments field are displayed for users to show what html tags they can use, I find a lot of clients just want to hide those HTML tags as they think it may discourage some users from leaving comments.

comments-html-tags-attributes

To hide the tags you need to add a function and  filter in your functions.php file

//Remove comment form HTML tags and attributes
function genesischild_remove_comment_form_allowed_tags( $defaults ) {

	$defaults['comment_notes_after'] = '';
	return $defaults;

}
add_filter( 'comment_form_defaults', 'genesischild_remove_comment_form_allowed_tags' );

 

Also to change the actual comment heading, originally set to “Leave a Reply”  to something else like “Leave a Comment”  you can add another function and filter.

//change the comments header
function genesischild_comment_form_defaults( $defaults ) {

	$defaults['title_reply'] = __( 'Leave a Comment' );
	return $defaults;

}

add_filter( 'comment_form_defaults', 'genesischild_comment_form_defaults' );

comments-html-tags-attributes-removed

And this is what you are left with.

3 Comments

  1. adana evden eve on July 12, 2015 at 10:06 am

    thank you

  2. ravee on March 4, 2015 at 8:14 am

    ya thank u so much,amazing guide

  3. Kristine on December 10, 2014 at 1:49 am

    THANK YOU! This is exactly what I was looking for and worked perfectly! 🙂

Leave a Comment





%d bloggers like this: