How To: Remove URL Field From GeneratePress Comments Section

Combating spam is a huge concern for every site owner.

But if you are a GeneratePress user, it can be done with ease.

People usually spam your blog by adding links while posting comments on your site. When they see a URL field, they spam!

Spam Comment

So, the solution is to remove the URL field from the comments section entirely.

How to remove URL field from GeneratePress comments section

There is a sweet and simple solution for GeneratePress users. Copy the code given below and add it to your theme’s functions.php file.

Once done, clear caches and see the magic!

/* Remove URL Field From GeneratePress Comments Section */
add_action( 'after_setup_theme', 'gp_add_comment_url_filter' );
function gp_add_comment_url_filter() {
add_filter( 'comment_form_default_fields', 'gp_disable_comment_url', 20 );
}
function gp_disable_comment_url($fields) {
unset($fields['url']);
return $fields;
}

There is one more way to combat WordPress comments spam. People add links to WordPress comments and WordPress parses the text link to clickable link automatically.

You can disable this by following this tutorial: Disable auto-linking of URLs (clickable links) in WordPress comments.

Make sure to follow us on Facebook and Twitter to stay updated with all our updates.

Source: GeneratePress Forums

Leave a Comment

Your email address will not be published. Required fields are marked *

Share via
How To: Remove URL Field From GeneratePress Comments Section
Scroll to Top
Send this to a friend