Skip to:
Content
Pages
Categories
Search
Top
Bottom

Profanity Filter! Any suggestions?


  • ladydekade
    Participant

    @ladydekade

    Hey Guys!

    So i’m trying to find a profanity filter that will work on bbPress as well as buddypress. I’ve tried a few but none block profanity on the Activity feeds (buddypress pages).

    Can any one suggest a plugin? I don’t mind paying for one.

    Thanks

Viewing 16 replies - 1 through 16 (of 16 total)

  • ladydekade
    Participant

    @ladydekade

    Ugh, meant to put this in how to!


    bp-help
    Participant

    @bphelp

    @ladydekade
    You can try this:
    https://wordpress.org/plugins/wp-content-filter/
    and try patching it like this:
    http://www.presscoders.com/plugins/wp-content-filter/#comment-61385
    Let us know if that works out. The only other option I see is a paid service:
    https://wordpress.org/plugins/webpurifytextreplace/


    ladydekade
    Participant

    @ladydekade

    Heya!

    Im open to paying for one, but I’m not sure if WebPurify will block swearwordzzz on the ACTIVYT (buddypress) as well as BBpress forums – do you know if it does?

    Z


    bp-help
    Participant

    @bphelp

    @ladydekade
    No I haven’t tested either one. I would suggest trying the free plugin (wp-content-filter) and adding the patch before purchasing a service. Try it out then if it doesn’t work let us know.


    bp-help
    Participant

    @bphelp

    @ladydekade
    For donuts and coffee I tested it myself and it works but if you copied and pasted that patch code from the site it won’t work because the single quotes are not right. In wp-content-filter.php at line 208 add this:

    
    add_filter('bp_get_activity_action', 'pccf_filter');
    add_filter('bp_get_activity_content_body', 'pccf_filter');
    

    Save it, and in the plugins options copy and paste this great list for swear words:
    http://www.ourchangingglobe.com/misc/badwords-comma.txt
    In the keywords to remove! Hope that helps!


    bp-help
    Participant

    @bphelp

    @ladydekade
    You will also want to add this below the above code so it covers bbPress!

    
    add_filter('bp_get_the_topic_title', 'pccf_filter');
    add_filter('bp_get_the_topic_post_content', 'pccf_filter');
    

    In that list of swear words you may find a few words with a semi-colon(;) after them. You will need to remove those semi-colons as all is required is a comma to separate the words. You can also add other swear words to that list if it missed any! Cheers!


    ladydekade
    Participant

    @ladydekade

    Ahmazing, thanks for your quick replies 🙂 Am just nutting out a few other issues then will be jumping back on this one.

    Z


    bp-help
    Participant

    @bphelp

    @ladydekade
    After further thought you may want to add the code supplied in bp-custom.php instead of modifying the code in the plugin because if you update that plugin in the future it will be overwritten and you would have to add it back but if it is in bp-custom.php it will remain untouched!


    Kairimo
    Participant

    @fitrighani

    Hi, I’m using Buddypress Version 1.7.2 and WP Content Filter Version 2.33. i already add your code at line 208 and it doesn’t work. i also add it into bp-custom.php file and also doesn’t work. did you have any suggestion for me.

    Thanks


    bp-help
    Participant

    @bphelp

    @fitrighani
    You must have entered something wrong because I have it working. On line 208 in wp-content-filter.php which is an empty line just add:

    
    add_filter('bp_get_activity_action', 'pccf_filter');
    add_filter('bp_get_activity_content_body', 'pccf_filter');
    add_filter('bp_get_the_topic_title', 'pccf_filter');
    add_filter('bp_get_the_topic_post_content', 'pccf_filter');
    

    You will need to search google to find a list of swear words to add to the plugins dashboard filter options because the link I used is no longer available. Also make sure the words are separated by a comma like so:

    a*s,d**k,p***k,d*m

    Good luck!


    Kairimo
    Participant

    @fitrighani

    Hi @bphelp, thanks for your reply. it works for me. Thanks. But is it possible for me to filter bad word in the feeds and also feeds comment?


    firebuddy
    Participant

    @firebuddy

    Hi just incase you are still looking for a fix, you need to add this line below the lines you have already added…

    add_filter(‘bp_activity_comment_content’, ‘pccf_filter’);


    Kairimo
    Participant

    @fitrighani

    Hi, But still 1st layer comment cannot be filter..


    geistschatten
    Participant

    @geistschatten

    So I got it to work when I put this after line 287:

    add_filter('bp_get_activity_action', 'pccf_filter');
    add_filter('bp_get_activity_content_body', 'pccf_filter');
    add_filter('bp_get_the_topic_title', 'pccf_filter');
    add_filter('bp_get_the_topic_post_content', 'pccf_filter');
    add_filter('bp_activity_comment_content', 'pccf_filter');

    I’m not really one for PHP though, so I’m not sure if that works entirely fine. I was able to filter the comments with that code too.

    Basically you’re adding it to the plugin filters so that it thinks it should also filter through the comments and activity.

    For further reference, line 284 should start like this and then end where it says “//bbPress specific filtering…” (make sure the apostrophes are showing up right, if you copy and paste code sometimes they get messed up but look the same, that’s why the comments weren’t happening before):

    	if ( isset( $tmp['chk_post_content'] ) ) {
    		if ( $tmp['chk_post_content'] == '1' ) {
    			add_filter( 'the_content', 'pccf_filter' );
    			add_filter( 'get_the_excerpt', 'pccf_filter' );
    add_filter('bp_get_activity_action', 'pccf_filter');
    add_filter('bp_get_activity_content_body', 'pccf_filter');
    add_filter('bp_get_the_topic_title', 'pccf_filter');
    add_filter('bp_get_the_topic_post_content', 'pccf_filter');
    add_filter('bp_activity_comment_content', 'pccf_filter');
    		}

    bp-help
    Participant

    @bphelp

    @geistschatten
    I am fairly certain you could fork that plugin if you wanted with some of the additions you made as well as others being that it is GPL and adding the support for BP etc. and adding it to the repository but you should give the original authors credit as well as any contributor. I am sure other BP users would love a plugin to help with profanity that they didn’t have to modify because not everyone is comfortably adding code, of course this is just a suggestion and I thought about doing it a few years back but I prefer writing my own code because I know it best but if you or someone else does it I think it would be a welcome addition. Good luck!


    john
    Participant

    @johnpaulbeaver

    I’d love to see this thing forked and maintained and agree it would probably be very popular.

    It would also be very cool to have a option added in a member’s profile settings to turn on/off the profanity filter while they view the site.

Viewing 16 replies - 1 through 16 (of 16 total)
  • The topic ‘Profanity Filter! Any suggestions?’ is closed to new replies.
Skip to toolbar