Quantcast
Channel: WPInsite » URL
Viewing all articles
Browse latest Browse all 2

Remove the URL Field From Your Comment Form

$
0
0

This code snippet will demonstrate how to remove the URL field from your WordPress Comment form.Due to the amount of spam that can be posted to WordPress sites in the comment form there may be times when you wish to remove the URL field altogether from your WordPress site. The URL field can be a magnet for spammers trying to advertise their sites, so removing this field may help in reducing the amount of spam posted in your comment forms.

Remove the URL Field

To remove the URL field we first need to open our our [pre]functions.php[/pre] which is usually located in our active theme directory. [pre]wp-content/themes/my-active-theme[/pre].

At the bottom of this file add this code snippet:

function remove_comment_fields($fields) {
unset($fields['url']);
return $fields;
}
add_filter('comment_form_default_fields','remove_comment_fields');

Once this code snippet has been added, simply re-save your functions.php file.

Be sure to check out our other great WordPress Code Snippets and WordPress Articles.

Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images