Disable Comment URLs Without Plugin to stop spammy links in your WordPress comments. This quick tweak removes the website field from the comment form, which discourages link spam.
Add the Code to Remove URL Field
Add this to your child theme’s functions.php
:
// Disable Comment URLs in WordPress
function qdt_remove_comment_url_field($fields) {
unset($fields[‘url’]);
return $fields;
}
add_filter(‘comment_form_default_fields’, ‘qdt_remove_comment_url_field’);
How It Works
This code uses the comment_form_default_fields
filter to remove the “Website” input from your comment form.
Why Disable Comment URLs?
Most comment spam aims to get backlinks. Removing the URL field cuts down spam and makes moderation easier.
Common Mistake
This won’t remove existing links in old comments. Manually moderate old comments if needed.
Pro Tip
Combine this tweak with a good spam filter plugin like Akismet for stronger spam protection.
Related Snippet
If you liked this, check out my Disable Comments Without Plugin in WordPress guide for blocking comments site-wide.