How to Remove the URL Field From WordPress Comments
Last modified: June 22, 2026
The URL (or “Website”) field in WordPress comments has a history worth knowing. In the early 2010s, it let bloggers link to their own sites when leaving comments, which was a genuine part of how blog communities worked. That context is mostly gone. What remains is a form field that spambots target specifically because a successfully published URL on your domain is a free backlink to whatever site the bot operator is promoting.
The result is predictable: if your site allows comments, you likely see a steady stream of submissions with names like “best online casino” and URLs pointing to sites you would never want to link to. Akismet and other spam filters catch most of these, but they still land in your moderation queue, and some slip through. Removing the URL field is one of the cleanest ways to reduce this noise because it eliminates the thing spambots are actually after.
This guide covers two standard approaches (PHP snippet and plugin), what to know about Block Themes if you are running a newer WordPress installation, and how to confirm the field is actually gone after making the change. Existing comments are not affected by any of these methods: URL data already stored in the database stays there, it just will not be collected from new submissions.
How to Remove the Website Field From WordPress Comments
The method you choose depends on whether you want to edit a PHP file directly or prefer a plugin-based toggle.
* 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:
- Install and activate Comment Form Fields Editor from Plugins > Add New.
- Go to Settings > Comment Form Fields.
- Locate the Website (URL) field and uncheck it or toggle it off.
- 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.
Block Themes and Full Site Editor: What Changes
If your site uses a Block Theme (introduced in WordPress 5.9) and the Full Site Editor rather than a Classic Theme, the standard PHP snippet still works for the comment form, but there is an important difference to be aware of.
Why this matters for Block Themes:
Block Themes render the comment form through a block-based template, typically the comments.html template part in your theme’s /templates/parts/ folder. The comment_form_default_fields filter still fires and still removes the URL field from the PHP-rendered output. However, some newer Block Themes override the comment block with a custom block implementation that may not go through the standard filter at all.
How to check whether the PHP snippet is working in your Block Theme:
- Add the PHP snippet to your active theme’s
functions.phpor a site-specific plugin. - Navigate to any post on your site that has commenting enabled.
- Scroll to the comment form. If the Website field is gone, the snippet worked.
- If the field is still showing, your theme is using a custom block for comments. In that case, check your theme’s Block Templates in the Site Editor (Appearance > Editor) and look for a Comment Form block or Comments Query Loop block. Some themes allow you to edit the comment form layout directly in the block editor and simply delete the URL field block from the template.
Plugin alternative for Block Themes:
The plugin approach (Comment Form Fields Editor) typically works with Block Themes because it hooks into the same filter. But if the theme bypasses standard WordPress filters, the plugin will not work either. In that situation, editing the block template directly in the Site Editor is the most reliable fix.
For the majority of sites using popular Block Themes like Twenty Twenty-Four or Kadence’s block theme, the PHP snippet approach works without issue.
Verifying the Change and Checking Your Spam Queue
After making the change with either method, do a quick verification before considering the task done.
Verify the URL field is removed:
- Open your site in a private/incognito browser window. This ensures you are not seeing a cached version of the form.
- Navigate to any published post with comments enabled.
- Scroll to the comment form. The Website field should be absent. The form should show only Name, Email, and the comment text area.
- Right-click the comment form and choose Inspect Element. Search the form’s HTML for
id="url"orname="url". If those attributes are gone, the field has been removed at the HTML level, not just hidden with CSS.
What to expect from your spam queue afterward:
Most sites see a drop in spam comment submissions within 24 to 72 hours. The reduction is not always immediate because some spam networks cache target URLs and keep submitting for a short period even after the field disappears. After about a week, the volume typically drops to near zero for the lowest-effort bot traffic.
Akismet and similar tools still catch the small amount of keyword-stuffed spam submitted through the comment body. Removing the URL field does not eliminate all spam, but it removes the category that was specifically targeting your site for link building.
What about existing comments with URLs?
URLs already stored in your comment database are not deleted by either method. If you want to clean those up, you can do a direct database search in phpMyAdmin for the comment_author_url column in the wp_comments table and selectively clear URL values from older spam entries. This is optional and only makes sense if you have a large number of spam-approved comments that slipped through your filter in the past.
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.
If your site runs a Block Theme, the PHP snippet usually works the same way. If it does not, check whether your theme’s comment block overrides the standard filter and edit the template directly in the Site Editor instead.
After making the change, verify it with a private browser window, not just your logged-in admin view. Check your spam queue over the following week. Most sites see a noticeable drop in bot-submitted comments within a few days, since the URL field is the main target for link-building spambots rather than the comment text itself. For a broader approach to keeping your comment section clean, read our guide on WordPress antispam plugins.

Website Maintenance – Use Promocode: scanwp
Advanced JetPlugins for Elementor
Semrush 14 days trial
Kinsta – Managed WordPress Hosting
Bluehost Hosting