Warning:Cannot modify header information - headers already sent by, When Adding Friends on Buddypres


This is happening when i Click :Add Friend"
It does function and I do get the "friendship Requested"

Here is the exact error:

Warning: Cannot modify header information - headers already sent by (output started at /home/content/88/8949788/html/desi/wp-content/themes/studio/_inc/ajax.php:431) in /home/content/88/8949788/html/desi/wp-content/plugins/sitewide-privacy-options/sitewide-privacy-options.php on line 496

Any ideas why this is happening?


  • Kimberly
    • Champion of Loops

    Hi Aaron,

    This looks like an issue within your theme files. The first item referenced is usually a good idea of where the problem lies. In this case (output started at /home/content/88/8949788/html/desi/wp-content/themes/studio/_inc/ajax.php:431) your ajax.php line 431.

    Have you made any customizations to your theme? Just to be sure it's a theme issue you can switch to a default twenty theme and see if the error disappears. If it does then you should open the file and check to be sure there are no extra white spaces in the file.

    - Open the file in a plain text editor (NOT MS Word or similar. Notepad or BBEdit is fine).
    - Check that the very first characters are <?php
    - Check that the very last characters are ?>
    Check to make sure there are no extra spaces near line 431

    If that doesn't work we will look into what else could be causing your issue. :slight_smile:



    If the above action did not result in the resolution or common end to this ticket then please feel free to come back here for comment. Just be sure you mark "Not Resolved" to re-open or we might miss it! :slight_smile: Thanks!

  • Aaron
    • Site Builder, Child of Zeus

    Hi Kimblerly,

    I did try this but suspect it is the Multisite Privacy plug in

    Dactivating the Multisite Privacy plug in fixes the issue. Errors disappear

    This error also happened when I try to see the next page of Members:

    Warning: Cannot modify header information - headers already sent by (output started at /home/content/88/8949788/html/desi/wp-content/themes/studio/members/members-loop.php:14) in /home/content/88/8949788/html/desi/wp-content/plugins/sitewide-privacy-options/sitewide-privacy-options.php on line 496

    Now no errors, but do need Multisite Privacy. Here is what line 496 environment looks like:


    function additional_privacy_set_default($blog_id, $user_id) {
    global $wpdb;
    $privacy_default = get_site_option('privacy_default');
    if (!$privacy_default) {
    $privacy_default = 1;
    update_blog_option($blog_id, "blog_public", $privacy_default);
    $wpdb->query("UPDATE $wpdb->blogs SET public = '". $privacy_default ."' WHERE blog_id = '". $blog_id ."' LIMIT 1");

    Any idea what is happening?

  • Aaron
    • Site Builder, Child of Zeus

    Sorry gave you the wrong section . Here is line 494 to 497 of sitewide-privacy-option.php

    $file_value = hash_hmac('md5', "{$blog_id} file access yes", LOGGED_IN_SALT);
    setcookie( "spo_{$blog_id}_fa", $file_value, time() + 1800, $current_blog->path);

    Does this look ok?

  • Kimberly
    • Champion of Loops

    It looks ok, yes

    From your error something in your theme is causing an issue with this line of code. Something about your loop is not making the cookie and login check with Multisite happy.

    Same thing with the first ajax error. Your theme is not playing nice with Multisite cookies it looks like. Have you cleared your cahce lately?

  • Aaron
    • Site Builder, Child of Zeus

    Hi Kimberly

    I changed the theme to Buddypress Community. The errors persist and the Slideshow is not transitioning smoothly. The slides are shifting too quickly or not completing the picture comletely.

    Any suggestions?


  • aecnu
    • WP Unicorn

    Greetings desibizbuy,

    We have not heard back from you as to the status of this issue.

    If you are still having an issue please let us know so that we may try to get you fixed up as soon as possible by choosing to check mark this ticket as unresolved below and posting any new errors or symptoms you are noticing.

    This action will also bring your ticket up front back in plain view again within the ticket system.

    Thank you for being a WPMU Dev member!

    Cheers, Joe

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.