The Must Have for WordPress
The Must Have for WordPress
×
  • Home
December 5, 2019
WordPress

Remove the URL field in the WordPress comments form

by Martin Jost
No comments
1 min Reading Time
716 Views
5 Score
2 Likes
Share on Facebook Tweet on Twitter Share on Linkedin Pin on Pinterest Send via E-Mail Send via WhatsApp

As we know, comments are often misused by website visitors to get external links. Outgoing links are now automatically marked with the rel="nofollow" attribute. Nevertheless, many comments are based still on the intention to get an external link.

Such spam comments often have little meaning and can sometimes be very annoying. However, this can be easily solved by removing the URL field from the WordPress comment form.

How can I remove the comments URL field?

To remove the URL field from the comment form, we use the WordPress filter comment_form_default_fields. Just add the following code snippet, for example into the functions.php of your theme:

With the exception of spam comments generated by robots, you will no longer get spam comments by your website visitors with the intention to set an external link.

Last updated: December 5, 2019

Remove the URL field in the WordPress comments form Score: 5 / 5 (1vote)
Share on Facebook Tweet on Twitter Share on Linkedin Pin on Pinterest Send via E-Mail Send via WhatsApp
The Author
Published by
Martin Jost

View all posts by Martin Jost

Related Posts
C
PHP Convert HEX color to RGBA color code in PHP

While working with theme or plugin options, in some cases we need to convert a hex (hexadecimal) ...

Read More
A
WordPress Anonymize IP address of WordPress comments

In the context of the European privacy policy regulations some regulations for web page owners a ...

Read More
C
Gutenberg Calculate the correct content width for the Gutenberg editor

The WordPress Gutenberg editor allows you to customize and edit web page content according to th ...

Read More
Read more
A
Previous Post
Add WordPress images to the RSS feed
A
Next Post
Anonymize IP address of WordPress comments
Leave a Reply Cancel reply

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

  • Imprint
  • Privacy Policy
© 2016-2023 - wphave - The Must Have for WordPress
Login

Lost your password?

RequiredEssential cookies enable basic functions and are necessary for the proper functioning of the website.
  • Name: Cookie Status
  • Provider: Owner of this website
  • Purpose: Is necessary to check whether the user's web browser allows cookies.
  • Privacy Policy: https://wphave.com/privacy-policy/
  • Cookie Name(s): cookie_status
  • Duration: 1 Minute
  • Name: Cookie Consent
  • Provider: Owner of this website
  • Purpose: Is necessary to check whether the user agrees to allow opt-in cookies or not.
  • Privacy Policy: https://wphave.com/privacy-policy/
  • Cookie Name(s): cookieconsent_analytics, cookieconsent_marketing, cookieconsent_status
  • Duration: 1 Year
  • Name: Like Button
  • Provider: Owner of this website
  • Purpose: Is necessary to check whether the user has already gave a like for a specific post.
  • Privacy Policy: https://wphave.com/privacy-policy/
  • Cookie Name(s): like_btn_{POST_ID}
  • Duration: 21 Days
  • Name: Post Rating
  • Provider: Owner of this website
  • Purpose: Is necessary to check whether the user has already rate a specific post.
  • Privacy Policy: https://wphave.com/privacy-policy/
  • Cookie Name(s): rating_{POST_ID}
  • Duration: 7 Days
AnalyticsStatistics cookies collect information anonymously. This information helps us to understand how our visitors use our website.
  • Name: Google Analytics
  • Provider: Google LLC
  • Purpose: Google cookie for website analysis. Generates statistical data on how the visitor uses the website.
  • Privacy Policy: https://policies.google.com/privacy
  • Cookie Name(s): _ga, _gat, _gid
  • Duration: 2 Years