How to Remove the URL Field From WordPress Comments
Last modified: August 23, 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 reason spambots care so much about the URL field is link equity. A link from your domain to theirs even buried in a comment passes a small amount of authority in their direction. Multiply that across thousands of sites and you get a meaningful signal. The URL field is the lowest-friction path to getting that link placed, which is why bots prioritize it over the comment body itself. Removing it cuts off that path entirely.
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 eliminates the incentive to submit those comments in the first place, not just catches them after they arrive.
This guide covers two standard removal approaches (PHP snippet and plugin), whether you can make the field optional rather than removed entirely, what to know about Block Themes, how to confirm the field is gone, and what to do about existing comments that already have URLs stored in your database.
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.
Can You Make the URL Field Optional Instead of Removing It?
WordPress’s default comment form marks the URL field as optional by default — it has no required attribute in the HTML. So technically the field is already optional. If what you actually want is to make it required for genuine commenters (to reduce anonymous spam), that is a separate task from removing it entirely.
If your goal is to keep the field but mark it as not required (which it already is by default), no changes are needed. If you want to remove it for everyone except logged-in users, the PHP approach can be wrapped in a conditional check: if (!is_user_logged_in()) inside the filter function. That way registered members of your site can still fill in their URL, but anonymous visitors cannot.
Most sites benefit more from removing the field entirely. Optional fields are still submitted by bots; removing the field eliminates the input vector.
Checking Your Theme’s Comment Filter Compatibility
Before adding the PHP snippet, you can verify whether your theme processes the standard comment_form_default_fields filter. Open a comment-enabled page on your site and use your browser’s Inspect Element to look at the comment form HTML. Find the input with name="url". If it exists, the filter approach will work. If you cannot find it and the URL field still appears on the front end, your theme may be outputting the comment form through a custom template that does not pass through the standard WordPress filter at all — in which case the Block Theme approach (Site Editor) is the right path.
* 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 for a specific reason: link equity. A link from a real, indexed website passes a small amount of PageRank to the destination. Spambots are not leaving comments to express an opinion — they are placing links at scale across thousands of sites to improve their target domain’s authority in search results. The URL field is the easiest way to do this because it creates a published link without requiring the comment body to contain anything useful or get past spam filters.
Removing the URL field has two effects:
- It eliminates the primary incentive to submit spam comments. Bots targeting the URL field stop submitting once there is nothing to submit to.
- 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. And those who do can always include a link in the comment body, where it will be moderated alongside the comment text.
WooCommerce note: If your site runs WooCommerce, product reviews use a separate comment template. The PHP method below also removes the URL field from WooCommerce product reviews. If you want to remove it from blog comments only and keep it on product reviews, 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.
If the above filter does not work (some themes call a different hook), try the comment_form_fields filter instead — it fires later in the rendering pipeline and catches cases the default fields filter misses:
function scanwp_disable_comment_url_late($fields) {
unset($fields['url']);
return $fields;
}
add_filter('comment_form_fields', 'scanwp_disable_comment_url_late');
Use only one of these two functions, not both. The second filter is the fallback if the first does not remove the field.
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.
- On multisite networks: this function only affects the site whose functions.php you edited. To apply it across all sites in a network, add it to a must-use plugin (mu-plugins folder) so it loads for every site automatically.
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.
Zero-plugin option if you have Yoast SEO: Yoast SEO includes a built-in toggle to disable comment URLs. Go to Yoast SEO > Site Settings > Site Features, scroll to the Comments section, and look for the “Comment author URLs” toggle. Switching this off removes the URL field sitewide without installing anything extra. This is the fastest path if Yoast is already active on your site.
Other plugins that include comment form field control:
- 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.php or 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, proceed to the Site Editor steps below.
Removing the URL field directly in the Site Editor:
- Go to Appearance > Editor in your WordPress admin to open the Full Site Editor.
- In the left navigation, click Patterns, then find the Comments template part (it may also be listed under Templates).
- Click into the Comments template part to edit it.
- Click on the comment form area. You should be able to select a Comment Form block or a Post Comments Form block.
- Inside that block, look for an Author URL field block or a block labeled “Website.” Click it to select it.
- Press Delete or use the block’s three-dot menu and choose Remove block.
- Click Save to apply the change to the template.
For themes like Twenty Twenty-Four, Twenty Twenty-Five, or Kadence’s block theme, the PHP snippet approach works without issue. You only need the Site Editor route if the PHP snippet leaves the field visible after adding it.
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 entirely, the plugin will not work either. In that situation, editing the block template directly in the Site Editor is the most reliable fix.
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.
Cleaning up existing comments that have spam URLs:
The removal methods above stop collecting new URL data, but they do not touch URLs already stored in your database. If you want to clean those up:
Using phpMyAdmin:
- Log into phpMyAdmin via your hosting control panel.
- Select your WordPress database.
- Click SQL and run:
SELECT comment_ID, comment_author, comment_author_url FROM wp_comments WHERE comment_author_url != '' LIMIT 100; - Review the results. To clear a specific URL:
UPDATE wp_comments SET comment_author_url = '' WHERE comment_ID = [ID]; - To clear all stored URLs in one pass (use only if you are certain you want this):
UPDATE wp_comments SET comment_author_url = '' WHERE comment_author_url != '';
Using WP-CLI (faster for large sites):
wp comment list --fields=ID,comment_author_url --format=csv | grep -v "^ID" | grep -v ",,$" # Then to clear all: wp db query "UPDATE wp_comments SET comment_author_url = '' WHERE comment_author_url != ''"
Database cleanup is optional. It only matters if you have a large number of approved comments with spam URLs that are still pointing to low-quality sites. For most sites, simply removing the field going forward is sufficient.
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 a minute. If the default filter does not work with your theme, the comment_form_fields fallback usually catches it. If you are managing someone else’s site or want a toggle from the admin panel, Comment Form Fields Editor is the right fit. And if you already have Yoast SEO installed, check its Site Features first — it may already have the option you need.
If your site runs a Block Theme and the PHP snippet does not take effect, go directly to Appearance > Editor, find the Comments template part, and delete the Website field block from the Site Editor. This works for any Block Theme where the PHP filter is bypassed.
On multisite networks: the functions.php approach only applies to the individual site where you add the code. To remove the URL field across all sites in a WordPress multisite network, place the function in a must-use plugin file (for example wp-content/mu-plugins/disable-comment-url.php). Must-use plugins load for every site in the network automatically.
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