wordpress snippets

How to Remove the URL Field From WordPress Comments

Last modified: May 26, 2026

Fiverr freelancers

The URL (Website) field in the default WordPress comment form is optional for visitors, but it’s a common target for spambots that submit URLs to boost their own link profiles. Removing it takes one of two approaches: a small PHP snippet in your functions.php file, or a free plugin if you’d rather not touch code. Either way, the change takes effect immediately and existing comments are unaffected.

Show More

* This button will show the rest of the post and open up an offer from a vendor

Why the URL Field Attracts Comment Spam

WordPress’s default comment form includes three fields: Name, Email, and Website (URL). The URL field was originally intended to let commenters link to their own blog, a convention from the early days of WordPress when blog networks were common.

Today it is a spam magnet. Automated bots submit comments with URLs pointing to low-quality or malicious sites, hoping to get a link published on your domain. Even with Akismet or other spam filters active, these submissions add noise to your moderation queue and occasionally slip through.

Removing the URL field has two effects:

  • It eliminates a vector spambots use specifically to get links placed. Most comment bots target the URL field, not just the comment body.
  • It reduces your moderation workload, since fewer spam comments are submitted in the first place rather than just caught after submission.

The trade-off is minor: genuine commenters who want to share their site can no longer do so via the comment form. In practice, most readers on content-focused sites do not use the URL field anyway.

WooCommerce note: If your site runs WooCommerce, note that product reviews use a separate comment template. The PHP method below will also remove the URL field from WooCommerce product reviews. If you want to remove it from blog comments only, use the plugin method, which gives you more granular control per form type.

Method 1: Remove the URL Field With PHP

The quickest way is to add a small function to your theme’s functions.php file. This method requires no plugin and the change takes effect immediately:

function ScanWP_disable_comment_url($fields) {
    unset($fields['url']);
    return $fields;
}
add_filter('comment_form_default_fields','ScanWP_disable_comment_url');

Add this to your functions.php file and the URL field will be removed from all WordPress comment forms on your site. The function hooks into the comment_form_default_fields filter and unsets the url key from the fields array before WordPress renders the form.

A few notes:

  • This only affects the default WordPress comment form. If you are using a third-party comment plugin (Disqus, Jetpack Comments, etc.), the plugin controls its own form fields.
  • Existing comments that already have a URL stored are unaffected. The URL data remains in the database, it just will not be collected from new comments.
  • If you are using a child theme, add the function to the child theme’s functions.php to avoid losing it on theme updates.

If you are not comfortable editing PHP files directly, see Method 2 for a plugin alternative. You can also read about WordPress antispam plugins for a broader approach to comment spam reduction.

Method 2: Use a Plugin Instead

If you would rather not edit PHP files, a plugin like Comment Form Fields Editor (free on the official WordPress plugin repository) lets you control which fields appear in the comment form from the WordPress admin without any code.

To use it:

  1. Install and activate Comment Form Fields Editor from Plugins > Add New.
  2. Go to Settings > Comment Form Fields.
  3. Locate the Website (URL) field and uncheck it or toggle it off.
  4. Save. The field is immediately removed from your comment form.

This approach is fully reversible. You can turn the field back on at any time from the same settings screen. It is the better choice if you are managing a site for a client who may want to re-enable the field later without needing a developer.

Other plugins that include comment form field control:

  • Yoast SEO: Includes a “Comment URLs” setting under its Social settings that disables the URL field sitewide. If Yoast is already installed, this is the simplest option with zero additional plugins.
  • Jetpack: Replaces the comment form entirely with its own system. The URL field behavior depends on Jetpack’s own settings, not WordPress defaults.
  • Security plugins (Wordfence, iThemes Security): Some include comment spam options, but few offer field-level control. These are better suited to blocking spam submissions after the fact rather than removing the URL field specifically.

For most sites, either the PHP snippet or Comment Form Fields Editor is the right tool. The PHP approach is permanent and requires no plugin management; the plugin approach is better when you want a toggle you can control from the admin panel.

Final Word: Remove the URL Field From WordPress Comments

If you are comfortable with PHP, the functions.php snippet is the cleaner option: no extra plugin, no database entries, done in 30 seconds. If you are managing someone else’s site or want a setting you can toggle from the admin panel, a plugin like Comment Form Fields Editor is the better fit.

Either method removes just the URL field. Name and Email fields remain, so the core purpose of the comment form (letting readers identify themselves) is unchanged. Visitors can still leave comments; they just cannot attach a website URL to them.

After making the change, leave a test comment on your site to confirm the URL field is gone from the frontend. Check your spam queue over the following week. Most sites see a noticeable drop in spam comment submissions within 24-48 hours, particularly the low-effort bot submissions that submit only a name, URL, and generic comment body.

Recap:
Save 4 Later
Email liked links to yourself

    Stay Updated with WordPress Insights

    Get the latest WordPress tips, theme reviews, and industry deals delivered to your inbox.