Support » Fixing WordPress » Locked out – Cannot modify header information

Viewing 15 replies - 1 through 15 (of 17 total)
  • Moderator Steve Stern

    (@sterndata)

    Support Team Volunteer

    This may be a plugin or theme conflict. Please attempt to disable all plugins, and use one of the default (Twenty*) themes. If the problem goes away, enable them one by one to identify the source of your troubles.

    See http://www.wpbeginner.com/plugins/how-to-deactivate-all-plugins-when-not-able-to-access-wp-admin/

    Once you’ve regained access to your site, either restore the files you were editing from a backup or download a fresh copy of your theme from its original source and replace those files.

    In general, it’s a Very Bad Idea to edit files via appearances->editor. Download the files using an FTP program like FileZilla. Make a safe copy, do your edits, and then upload the result. If all is good, you’re done. If not, you always have that safe copy as a fallback.

    If you’d like us to look at the file in question, please put it on gist.github.com and paste the link to the gist here.

    nop same error.. any other solutions? i have one which is hostgator cpanel backup but it will cost me and i would like to try everything before i try that, so sir, is there any other ideas? since we know its not the plugins what else can it be? what else can i do?

    Moderator Steve Stern

    (@sterndata)

    Support Team Volunteer

    Replace the files you were editing with their original versions.

    Exactly what files did you edit?

    i only edited one which was the functions.php in the appearence > editor and the code i pasted was

    add_filter(‘tiny_mce_before_init’,’tinymce_allow_unsafe_link_target’);
    function tinymce_allow_unsafe_link_target( $mceInit ) {
    $mceInit[‘allow_unsafe_link_target’]=true;
    return $mceInit;
    }

    but i somehow ended up with 2 } like

    }
    }

    which gave me a “syntax error, unexpected functions.php line 48” something like that, then i asked hostgator to remove the code(which was the dumbest thing i could do) because i couldnt log into filezilla… so then the person changed the theme from my current one to default one which i wasnt happy about, so he reverted it back to normal then we worked on me logging into filezilla, and once i did log in all i did was remove the extra } which was on line 48, after that the syntax error was gone BUT the site was no longer the same, the backround color was changed, few widgets were not on the sidebar, the header image was gone, the menu was changed and few other details like this… so i made few appeareance changes in the customizer and when i was trying to change the header image the media library wount load, then i tried uploading a file and it wouldnt crop.. so i just thought il delete the cache, once i did that i was logged out and then i noticed i cant access wp-admin..

    its just weird i mean maybe im not the first but ive read so many articles and nobody had a situation like mine…

    maybe i havent edited the file correctly.. i mean thats what was shown in the tutorial “how to” but i right click on the file and pressed view/edit and just deleted the 48th line and saved the file,

    i mean that was what the tutorial showed me.. also at that time i dint have notepad++ because i only downloaded it to find the line 1210.. could it be that i opened the file with normal notepad?

    Moderator Steve Stern

    (@sterndata)

    Support Team Volunteer

    Do not edit core WordPress files! Do not touch pluggable.php

    I don’t see any syntax error in what you put in the gist. Currently, what’s the EXACT error message you see?

    i did not touch pluggable.php ever, ive only downloaded the file to see the 1210 line, the syntax error is fixed, as i mentioed above the duoble line of

    }
    }

    caused the syntax error which is fixed now,

    the website is working fine BUT if i go fungadgetworld.com/wp-admin/ then i get this

    Warning: Cannot modify header information – headers already sent by (output started at /home2/kingschild/public_html/fungadgetworld.com/wp-content/themes/worldstar-child-theme-01/functions.php:1) in /home2/kingschild/public_html/fungadgetworld.com/wp-includes/pluggable.php on line 1210

    Moderator Steve Stern

    (@sterndata)

    Support Team Volunteer

    Make sure you do not have a closing ?> on functions.php or have any trailing blanks at the end.

    yep, it ends with }

    Moderator Steve Stern

    (@sterndata)

    Support Team Volunteer

    Hmm….

    The error seems to be on line 1

    Warning: Cannot modify header information – headers already sent by (output started at /home2/kingschild/public_html/fungadgetworld.com/wp-content/themes/worldstar-child-theme-01/functions.php:1)

    Make sure there’s nothing before that initial <?php

    well i mean this is line 1 on functions.php

    <?php

    with no spaces before it, could it be something to do with format of the file? like ive used and opened the file to edit with notepad maybe i was supposed to use a special program for that?

    Moderator Steve Stern

    (@sterndata)

    Support Team Volunteer

    It should be OK, but just for fun, rewrite that first line in case there’s some unprintable character at the top.

    i have actually already tried before you said it and have tried that again just now, still not working, im getting really worried now.. hostgator themselves said that this backup is not 100% that the website will be the same as when the backup was saved…

    is there any other solution possibilities?

    Moderator Steve Stern

    (@sterndata)

    Support Team Volunteer

    All you need is a backup of your child theme, not the whole shebang.

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘Locked out – Cannot modify header information’ is closed to new replies.