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.
If you want to hide this note sayings ‘HTML tags help’ from your comment box then there are 3 ways to achieve this task.
- By style.css
- By comments.php
- By functions.php
- 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.
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.
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
Thank you for your comment Jack !
Amazing! Thank you.
Very interesting article.Thank you.
I’ve just used this. Couldn’t get it to work using style or functions but the replacement code in comments worked a treat.
Thanks for posting!
Katie