How To Remove HTML Tags Help Text From WordPress Comment Form

By default, WordPress includes default comment note of basic HTML tags helps in post comment form. You have probably seen that note in the little text below in the comment form.

comment-box-smallenvelop

If you want to hide this note sayings ‘HTML tags help’ from your comment box then there are 3 ways to achieve this task.

  1. By style.css
  2. By comments.php
  3. By functions.php
  1. By style.css – Open your theme’s style.css file and add this piece of code at the end of this file.
/* Paste code at the end of the style.css file */
.form-allowed-tags{
display: none;
}

2. By editing comments.php – This is an alternative to the above method. Open your theme’s comments.php file find the below code.

<?php comment_form(); ?>

Replace this above code with the code mention below.

<?php comment_form(array('comment_notes_after' => '')); ?>

3. By functions.php – This is an another alternative to the above method. Open your theme’s functions.php file and add the following code to this file.

add_filter( 'comment_form_defaults', 'remove_comment_form_allowed_tags' );
function remove_comment_form_allowed_tags( $defaults ) {

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

}

After any of this action your comment form will look this.

comment-smallenvelop

Conclusion

Hope this tutorial help you to remove HTML tags help text and improve your WordPress comment box. If you have any queries please feel free to comment.

5 thoughts on “How To Remove HTML Tags Help Text From WordPress Comment Form”

  1. Hi Poonam,
    Thanks for the instructions on how to remove the html
    code in the comments box. I use the Songwriter theme and had tried
    several methods–none worked.
    I tried your Style.ss method and it worked like a charm!!
    Sincerely, Jack MacIsaac

    Reply

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.