In most standard WordPress themes, you’ll see before and after comment notes. This is an example from Twenty Twelve theme:
I’ve seen many people asking how to remove any of these notes. It turned out that this is very simple to do. Using
comment_form_defaults filter, we can easily customize the notes or completely remove them.
Here’s a working snippet that can be placed on
functions.php file of your theme.
comment_form_defaults filter accepts many parameters and to customize the before notes, we need to pass
comment_notes_before parameter and to customize the after notes, we need to pass
comment_notes_after parameter. The code above will completely remove the before and after comment notes. Here’s the result:
If you wish to change the before and after notes, simply put your text inside the
' ' tag and it will overwrite the default notes. Example:
$fields['comment_notes_before'] = 'This is an exampe of before comment notes.'; // Overwrite the default before comment notes.
We hope this tutorial helped you to edit or remove before and after comment notes on your WordPress site. If you’ve any question feel free to drop your comment below.
Leave a Reply