Change or Remove “Html Tags & Attributes” on Comment Form

Most WordPress themes have the default comment notes enabled on the the comment form. You’ve probably seen the little text that informs a visitor or a potential commenter of what HTML tags are available for use on the comments:

You may use these HTML tags and attributes: <a href="" title="">
<abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code>
<del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Removing “Html Tags and Attributes” on Comment Form

To simply hide the text, add this css code on your child-theme’s style.css. On the Admin area, hover your mouse pointer on the Appearance section then click Editor. On the theme editor page, paste the code on the very bottom of the file. If you are using a Custom CSS plugin, place the code there instead. Note: Some WordPress themes may also accept css codes on the theme options which makes adding the code a little more convenient.

.form-allowed-tags {display: none;}

Changing “Html Tags and Attributes” on Comment Form

However, if you want to change the text on the comment form instead of hiding it, you can add this PHP code on your functions.php (on a child theme). This would be useful for adding a little note or reminder for a potential commenter.

function ra_comment_form_defaults( $defaults ) {
     $defaults['comment_notes_after'] = 'Warning! Spamming is against the law';
     return $defaults;
add_filter( 'comment_form_defaults', 'ra_comment_form_defaults' );

You may also use this method to completely remove the text instead of just hiding it. To remove the text, replace 'Warning! Spamming is against the law' with just the two single quotes '' This sets the value of comment_notes_after as an empty string.

Share This Post


Add a Comment
  1. Thanks for the tutorial.

  2. 0Hey Nice i added the class temporerly first and i would add the function later .Do you have any idea that in copyscape it showing the code at the bottom of Comments.


  3. How can i get the child theme in frontier theme to remove the html tag please help me

    1. Try to help yourself just a little bit. The instructions are already written on the post.

  4. Awesome! Easy to solve. Thank you!!

Leave a Reply

Please write your comments in english. I delete anything that even remotely resembles spam.

Note: When posting code, enclose it in pre and code tags.
e.g. Add code here