nofollow / disable links in Q&A

Hi,

I'm nearly ready to launch Q&A on my site, having translated the plugin and customised it for my theme. I'm worried about spammers, and in particular comment spam, and I was wondering if there are ways to cap the capabilities of the question / answer editors.

I need the ability to do one of the following - does anybody have any pointers?
- disable links
- force all links to include a nofollow attribute.

Thanks

Simon

    SimonB

    I keep answering my own questions, but I'll add this solution here in case it helps for the next version or for other users.

    I've fixed it so that all links in Q&A questions and answers automatically have nofollow added. It would probably be better to do it just for external links, but I couldn't get that to work and life's too short. In any case, it just requires two new lines in the edit.php file, _insert_post() function:

    First one is here:

    // Create new post
    $post = array_merge( $post, $defaults );
    $post['post_status'] = is_user_logged_in() ? 'publish' : 'draft';
    // **** New code: This will add rel=nofollow to all links
    $post['post_content'] = stripslashes(wp_rel_nofollow($post['post_content']));
    // **** End of new code
    $post_id = wp_insert_post( $post, true );

    Second one is here:

    // Update post
    $post['ID'] = $post_id;
    // **** New code: This will add rel=nofollow to all links
    $post['post_content'] = stripslashes(wp_rel_nofollow($post['post_content']));
    // **** End of new code

    The first one adds nofollow when a new post (question or answer) is created. The second when a post is edited.

    This will only affect the Q&A posts, not the regular blog posts.

    Enjoy!

    Simon

    aecnu

    Greetings Simon,

    Wow your input is greatly appreciated and after checking this ticket from start to finish, you submitted your ticket and within 25 minutes came up with a solution for your own ticket!

    This in many cases is faster then we could possibly respond due to what it takes to dig into what you are inquiring about.

    I will be sure to let the lead developer know about your code snippet and thank you very much for this.

    In addition, thank you for sharing this for other members too - those seeking this solution or wanting to incorporate it - well here it is courtesy of SimonB!

    Some rep points sent your way for the snippet.

    Thank you for being a WPMU Dev Member!

    Cheers, Joe