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) {
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

Ritesh Saini
Ritesh Saini
I’m a Professional Blogger & Internet Marketer living in India. Started my blogging and online marketing journey in 2013 when I was just 18 years old. You can see my work here on this blog and at

Best Managed WordPress HostingWPX Hosting
Best Managed Cloud HostingCloudways
Best Shared HostingSiteGround
Best Site & Page BuilderElementor
Beautiful WordPress ThemesElegant Themes
Lightest & Fastest WordPress ThemeGeneratePress
Best Lead Generation ToolOptinMonster
Best CDNStackPath
Best Domain RegistrarNamecheap

Related Posts

Leave a Comment

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

ShortPixel Logo 50% Extra Credits
ShortPixel Coupon
Use our exclusive ShortPixel deal and get 50% extra credits on your purchase of one-time credits.
PeerBoard Logo $59 for Lifetime
Get PeerBoard for Lifetime @ $59 ONLY!
PeerBoard lets you create Reddit style forums with ease. It is self-hosted and requires no technical expertise. Grab this lifetime deal before it's gone forever.
Share via
How To: Remove URL Field From GeneratePress Comments Section
Scroll to Top
Send this to a friend