Disable HTML in WordPress Comments

April 15, 2022 - Free

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 like this

Disable HTML WordPress Comments
Disable HTML WordPress Comments

This way is used for spam ar 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

Disable HTML Comments
Disable HTML Comments

All you have to do is open your functions.php and add the following code.

CODE

// This is comments URL remover //
add_filter('comment_text', 'wp_filter_nohtml_kses');
add_filter('comment_text_rss', 'wp_filter_nohtml_kses');
add_filter('comment_excerpt', 'wp_filter_nohtml_kses');

After Code

Disable HTML in Comments

If you do not want to manually add this code yourself, the original author also offers a plugin that you can download. Just install and activate the Comment Link Remove and Other Comment Tools Plugin.

The best thing about this method is that you do not need to change the basic files. If you want to edit your core files, you can go to wp-includes / kses.php and edit the codes there.

How To Remove Website URL From WordPress Comment

How to disable HTML in WordPress comments With Plugins?

You can easily disable HTML in WordPress comments by installing the Comment Link Remove plugin.

Log in to your WordPress dashboard, remove the comment link, install and activate the plugin. For more details on how to install the WordPress plugin, see this guide.

After installing the Comment Link Remove plugin, go to Settings in your WordPress Dashboard, and click on QC CLR Settings.

How to disable HTML in WordPress comments With Plugins

Now enable the 2 options below in the comment link removal settings.

Disable converting URLs to hyperlinks in comments.

Remove HTML link tags in comments.

How to disable HTML in WordPress comments
How to disable HTML in WordPress comments

This will disable the active HTML link tags in the comments. If someone adds HTML tags to the comments it will appear but the links will not work.

I hope this article has helped you disable HTML in WordPress comments.

Similar Apps