How-to and Troubleshooting
5
Posts
2
Users
0
Reactions
327
Views
Jun 11, 2024 6:50 pm
Hi i wanna try to modify the comment before its being saved. i wanna check for spam my own way with my own custom code, tho i cant get it to do anything apparently
i tried the following but its just not working so i assume there is maybe a custom hook for wpforo?
function preprocess_comment_remove_url( $commentdata ) { $commentdata["comment_content"] = "not a test"; return $commentdata; } // Hook our function to WordPress the_content filter add_filter( 'preprocess_comment' , 'preprocess_comment_remove_url', 10, 1);
4 Replies
Jun 12, 2024 1:12 pm
Hi @marcelderadmin,
wpForo Spam Control already removes all URLs of new registered users if you configure it. Just set the value of "Min number of posts to be able to post links" option for example 5 to remove all external URLs from posts of users who don't have at least 5 approved posts yet. The option is located in wpForo > Settings > Spam Control admin page.