How To Remove Comment URL Field from GeneratePress?

In today’s article, we are going to tell you two methods, using which you will be able to remove the url field from the comment box.

Whenever we visit any website, we are also given the option of a comment box to give our opinion, so that we can express our opinion about that website or that post or ask any question.

Below that comment box we get a box in which we can enter the url of our website or any url, the same box we call the comment box url field, we also use it to get backlink from any other website.

Why remove url field from comment box?

There are many reasons to remove url field from comment box but we are going to tell you the most important reason among them.

When there is a lot of traffic coming to a website, then the comments on that website also start coming in a lot, which becomes very difficult to see and manage and many of them are such people who want to comment spam. It seems that removing them is a very difficult task.

So we should remove url field from comment box to avoid these things. It is very easy to remove URL field from comment box, for this we are going to use two methods.

How to remove url box from comment box

This is a very easy method using which we can easily remove URL field from the comment box of generatepress theme but to use this method you have to paste some code in additional css of theme.

How to paste CSS code in additional css?

  • First of all, login to the WordPress dashboard of the website from which you want to remove the url field from the comment box.
  • Now after clicking on Appearance, you have to click on Customize.
  • Now the option of Additional CSS will appear, click on it, now you have to copy and paste the below given css code here and click on publish.
.comment-form #url{
display:none;
}

How to remove url field from comment using plugin?

In this method we will remove url field from comment box of generatepress theme using plugin, this method you can use in any version of generatepress theme whether it is free version or premium version.

  • First login to WordPress admin panel and click on plugins and then click on add new.
  • Now search by typing Code Snippets the search box .
  • Install and Activate the plugin.
  • Add a Snippet Title.
  • Copy and Paste the following Remove URL code.
  • Hit Activate Button.
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;
}

You can use both these methods on any version of generatepress theme whether it is free version or paid version of generatepress theme but the thing to note in this is to follow all the steps while inserting the css code.

Sharing Is Caring:

Hello Friends, My Name is Roton Kumar Roy (Founder) I am a Full-Time Blogger, Youtuber and Digital Marketer. I have start infotechbot.com for those people who want to learn Complete Blogging Course sitting at home for free online.

Leave a Comment