CoursePress Private live chat with teacher


I am having some trouble integrating the chat plugin with CoursePress. I have installed the chat onto the site, but I’m not quite sure how to set it up so that a student can chat with a teacher from the specific course they’re on. I see a little chat window pop up on the bottom right corner of the screen but it’s not very obvious who I’m sending the chat to. Is there some sort of integration guide that will help me allow students to chat to their teachers and vice versa in a way that is user-friendly?

Also, the chat takes a while to send and there’s no indication that the message is being sent, which might make users think it hasn’t gone through. Is there a way to have a sort of “Buffering” icon pop up while the message is sending?

Thanks in advance,


  • Michelle Shull
    • DEV MAN’s Apprentice

    Hi, Paul!

    Private chats in Chat only work between friends, and they require either BuddyPress (with the friends module active) or our Friends plugin. Otherwise, the on page, widget and corner chats are group chats.

    Chat isn’t directly integrated with CoursePress, meaning we did not create a function in CoursePress to manage chats. The two plugins work alongside each other, but as of this time they’re not fully integrated.

    To enable private chats between students and teachers, the two individuals will need to also be “friends.”

    As for the response time, what kind of hosting environment are you on? Chat is a very resource intensive tool, as we outline in the usage guide, so if you’re on a shared or otherwise resource-deficient server, you may see a performance drop. If you’re on a dedicated host (and are able to access/edit WordPress files) here’s a trick to up your site’s memory:

    If you have not yet increased the memory allocated to WordPress on your site (standard is 40M), now may be a good time to do so. Add the following to your wp-config.php file, before the line that says “That’s all, stop editing!”:

    define(‘WP_MEMORY_LIMIT’, ‘256M’:wink:;

    Hope this helps!

  • Brenda
    • Site Builder, Child of Zeus

    Hi Michelle, thanks for the memory fix!

    I was hoping with the “Complete Live ‘Chat’ Integration” mention on the CoursePress sales page, there’d be some more integration involved with the student/teacher. If I install the Friends plugin, is there any way for me to make it so that a Student is automatically added to a Teacher’s friendlist when enrolling in that Teacher’s course? I’m trying to find the best way to offer Live Chat in a way that is meaningful within CoursePress’ system.

    Let me know if that’s at all possible. Thanks for your help!


  • Michelle Shull
    • DEV MAN’s Apprentice

    Hey, Paul!

    I think this can be done with a few functions, but let’s consult the folks I’d bring in who know how to write these functions well (or second level team.) I know there used to be a BuddyPress plugin that would auto friend users, so that makes me optimistic about the possibilities. I’d think we’d just need to add a student_teacher_friends function to the enrollment process. Again, I’m not a dev, so let’s double check with the second level team. I’ll flag them right now.


  • Hoang Ngo
    • Code Slayer

    Hi @paul,

    If you’re using our Friend plugin, so here is the code which will connect instructor & student when a student enroll in a course.

    Please add this code to your theme functions.php or use mu-plugins

    add_action('coursepress_student_enrolled', 'link_tutor_student_friend', 10, 2);
    function link_tutor_student_friend($ID, $course_id)
    $instructors = get_post_meta($course_id, 'instructors', true);
    foreach ($instructors as $instructor) {
    if ($instructor != get_current_user_id()) {
    friends_add($instructor, get_current_user_id(), 1);

    If you have any issues please don’t hesitate to let us know so we can assist.

    Best regards,


Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.