1. Prevent Wordpress from turning text URL addresses into clickable links. This can be achieved easily by modifying the functions.php file of your theme using the editor in Wordpress admin area. All you have to do is add the following filter somewhere in there between the opening and closing php tags:
remove_filter('comment_text', 'make_clickable', 9);And if your theme doesn't have a functions.php file, you can simply create one, add the opening php tag, and paste in the filter afterwards.
2. Disable HTML links in Wordpress comments. This part is a tad harder, because you actually have to edit a Wordpress core file. That's right, believe me or not, as of 3.0.5 version of Wordpress, there's still no other way to disable certain tags in comments but to edit the kses.php core file (which gets overwritten with every update, so you have to add your hack again). Hopefully they will add a setting for this in your admin area in the future.
So, find the kses.php file in your wp-includes folder. Locate the part which says * @global array $allowedtags and comment out (e.g. add a double slash before) the tags we want to disallow in the comments (in our case we want to disable active links, so you'll want to comment out lines like 'a' and 'href'). Here's an example of how that part of a modified kses.php file looks:
/**Of course, you could simply delete the lines and it would have the same effect, but commenting out is preferred in case you will want to turn them back on sometime.
* Kses allowed HTML elements.
*
* @global array $allowedtags
* @since 1.0.0
*/
$allowedtags = array(
//'a' => array(
// 'href' => array (),
// 'title' => array ()),
As I mentioned before, this hack will disappear every time you upgrade your Wordpress, so keep a note handy somewhere so you will know what to edit.
3 comments:
Thanks for this valuable plugin. Did you have trouble with the current version?
^^ LOL your first comment on a post about preventing comment spam is spam!
Haha, yep. This blog runs on Blogger though, not Wordpress.
Post a Comment