Coolest Guides on the Planet

coolest guides on the planet

Coolest Guides On The Planet

  • Home
  • macOS
  • WebDev
  • All Posts
  • Contact

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

April 8, 2014 1 Comment

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.

Cats: WordPress

Tags

3gs 10.6 apache backup baseband boot clean urls cpanel css curl custom database drupal el capitan git Google image instadmg ios iphone jailbreak keys lion mac macos mojave macos sierra menu mysql OSX panda php phpmyadmin private public redirect redsn0w remote rsa SEO shell ssh terminal unstoppables upgrade urls

Donate a Beer to the Coolest Guides

Get Beaver Builder Now!

Copyright © 2023· Neil Gee - All Rights Reserved - Hosted by Runcloud

Copyright © 2023 · gee on Genesis Framework · WordPress · Log in