Disable HTML in WordPress Comments. By default, WordPress allows certain HTML tags in comments, such as <a> <em> <strong> etc. If you notice that many SPAM comments also have these tags. Most SPAM comments are made through bots and scripts, which use HTML tags.
If you disable only HTML from your WordPress comments, it can prevent a lot of spam. In this tutorial, we will show you how you can disable HTML tags in your WordPress comments.
This tutorial will only disable active HTML tags. So one can still post something like: & lt; a & gt; & lt; em & gt; & lt; Strong & gt;
First, You add the URL in the comments so show it like this
This way is used for spam or comments backlinks. so How to Stop Comments URL in your website. so get started now.
And it will appear, but the tags will not be active. So if someone uses strong tags, it will not make the text bold. Also, many SPAM bots do not have time to do this because this method takes a lot of time and it is not beneficial for them.
Go to your WordPress theme functions.php file edit and copy code and past hare on functions.php like this
All you have to do is open your functions.php and add the following code.
To disable HTML in WordPress comments, you can install and activate a plugin called “Comment Control” or “No HTML in Comments.” These plugins will strip any HTML tags from comments and prevent users from including them. You can also use the comment_form_defaults filter to remove the HTML tags. You will need to add this code in your functions.php file: