Category Archives: Wordpress

Remove website field from wordpress comment form

As website URL field is not mandatory but many times spammer use it to get backlinks to their website that results tons of garbage and spam comment. To get rid of spammer simply remove website field from comment form. To remove website field edit functions.php file in your WordPress theme folder and add following code

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

Add extra contact method in wordpress user profiles

WordPress has only two contact fields in users profile that is email and website. That may not be sufficient as there are many social networking sites (like Google+,facebook, twitter etc) are available to connect with users. We can add more contact methods in contact info section. To add more fields edit functions.php file in your WordPress theme folder and add below code.

function new_contactmethods( $contactmethods ) {
    $contactmethods['twitter'] = 'Twitter'; // Add Twitter
    $contactmethods['facebook'] = 'Facebook'; // Add Facebook
    $contactmethods['google'] = 'Google+'; // Add Google+
    return $contactmethods;
}
add_filter('user_contactmethods','new_contactmethods',10,1);  

Above code will add Twitter, Facebook and Google+ fields in contact info section