Menu bar

Friday 26 December 2014

Remove HTML unwanted comment tags from comment section.

REMOVE HTML COMMENT TAGS

By default WordPress includes basic HTML tags in the post comment form in order to allow commentators to use it for formatting there comments.

As you can see in the  image, comment form is listing some HTML tags in the below section.


But, many times it is not necessary to show these HTML tags in the form.

Moreover, with design perspective, displaying these tags doesn’t look good in the comment forms. So you can either remove or hide it from the comment form.

You can perform that task easily by CSS.
i.e. Display none that block.

Place this code in function.php file of your theme.

<?phpadd_action('init', 'unwantedtags');function unwantedtags() {global $allowedtags;// remove unwanted tags$unwanted = array('abbr','acronym','blockquote','cite','code','del','strike','strong','b','em','q');foreach ( $unwanted as $tag )unset( $allowedtags[$tag] );}?>


No comments: