Monday, November 30th, 2009
Get rid of comment author website URL in wordpress

The default comment form in Wordpress allows users to submit a website URL in their comment. Most often this is abused as a way to spam links onto your site.

You could simply remove that field from the comment form. But I like to keep it as I can easily spot incoming spam simply by looking at that URL while going over the comments in the site admin. Some people will actually take the time to write some false comment in hopes of getting approved and then sneak in a URL to Viagra or something like that. So keeping the website field helps me pick out those fake comments.

But I don’t want the URL to show up in the comment, only on the admin side. So to do that you simply edit 1 file in the wp-includes directory.

1. Look for the file called “comment-template.php”
2. Locate the bit of code that looks like this: (highlighted in yellow)

nourlcode1

Now change that to look like this: (I recommend simply commenting out the parts that you’ve removed in case you want to put it back - outlined in red)

nourlcode2

That’s it. Now when a user adds a website it won’t show up in the comment, but it will show up in your admin.

If you like it, share it:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • TwitThis

Leave a Reply