How To Remove URL Field From Comments In GeneratePress

Have you ever got random spammers and bots to comment on your posts, with their website URL? If yes, then this article is for you. Here I will show you how effectively you can remove URL field from comments in GeneratePress theme.

Thereby, completely preventing automated bots from spamming links on your website.

remove URL field from comments in GeneratePress

GeneratePress is a widely used theme in the WordPress eco-space. It is lightweight, has a modular approach with tons of customization options. Therefore, there have been more than 400,000 installations (at the time of writing) until now. If you want to know all the features of this amazing theme, I’d encourage you to read the GeneratePress review.

You can remove website from comments in GeneratePress via;

  1. WordPress Plugin
  2. CSS Code
  3. Code Snippets – GeneratePress “functions.php” file

Why Do You Need To Remove URL Field From Comments In GeneratePress?

The number one reason you’d wanted to remove URL field from comments is to protect your website from spam. According to the comment spam filtering company, Akismet. WordPress gets 487 Billion Spam Messages every month. Akismet controls and prevents 99.9% of spam. But, from our side, we are better off removing website field from the comment form.

example of spam comment on WordPress
Example of Spam Comment in WordPress

Nowadays, spamming is done via automated bots, in order to acquire backlinks from our site. This will spoil your SEO juice within a search engine’s database. In order to get rid of spam, have a powerful spam filtering plugin and also remove URL field from comments in Generatepress theme website.

That will give you peace of mind from spam.

Ways To Remove URL Field From Comments In GeneratePress

The easiest way to do this is by using a plugin. It’s easy for those who find it hard to perform coding on their WordPress websites.

Remove Website Field From Comments Using Plugin

  1. Within your WordPress Dashboard, look for Plugins, and click on Add New.
  2. In the Search Bar, type in Remove URL Field from Comment Form in GeneratePress Theme
  3. Install the plugin and Activate it.
comment section without website field

Check any of your blog posts and there shouldn’t be website/URL field in the comments section.

Also Read: Improve SEO by Adding Breadcrumbs in Generatepress Theme

Remove URL Field From Comments In GeneratePress Using CSS

This is another very easy method of removing URL field from comments section.

You can perform this method on GeneratePress free or GeneratePress premium version. All you need is a little bit of CSS code to implement into the GeneratePress theme customizer.

If you want to learn all the differences between both versions of the theme, read GeneratePress free vs premium article.

  1. Open WordPress Dashboard, go to Appearance, and click on Customize
  2. Go to Additional CSS
  3. Paste the following CSS Code and click on Publish
.comment-form #url{
	display:none;
}

Now, check a single post on your GeneratePress website.

remove website field from comments section in generatepress theme using css

Just a Two Liner code of CSS and you are done.

The next method is by manually entering code. In GeneratePress, if you want to enter any code into the functions php file. It is suggested to either get a child theme and perform the task on that or simply just install a plugin called Code Snippets.

We are going to install Code Snippets and run the code from it.

Remove URL Field From Comments In GeneratePress Using Code Snippets

For this, you will first need to Install and Activate the Code Snippets plugin.

  1. Once done, go to your WordPress Dashboard, hover your mouse on Snippets and click on Add New.
  2. Create a name for the Snippet
  3. Add the code
  4. Leave the “Run Snippet Everywhere” selected and let the Priority be at 10
  5. Click on Save Changes and Activate
code snippets to remove URL field from comments in GeneratePress
Remove URL field from Comments in GeneratePress – Code Snippet
add_action( 'after_setup_theme', 'tu_add_comment_url_filter' );
function tu_add_comment_url_filter() {
    add_filter( 'comment_form_default_fields', 'tu_disable_comment_url', 20 );
}

function tu_disable_comment_url($fields) {
    unset($fields['url']);
    return $fields;
}

This is how the comments section of a single blog post should like;

comment section without website/url field in generatepress
Comment form without URL field in GeneratePress

The above method is for those who don’t mind adding some code manually.

Conclusion

In this article, I am wrapping up over here with a feeling that it helps you to remove URL field from comments in GeneratePress theme. You can perform this on GeneratePress free as well as the premium version.

From the three methods mentioned above, I prefer and recommend you to go with installing a plugin or using CSS, if you are not comfortable with coding.

Otherwise, Code Snippets is the best plugin to insert code anywhere within your theme, without any hassles.

Feel free to leave any comments if you have any other ideas for performing this activity. Thank you.

Read More:

Ankur Purecha

I am in love with WordPress, building websites, doing SEO, and all that kind of stuff. I generally write about WordPress, Blogging, and SEO on BloggingIdol

Leave a Comment