Monday, September 28, 2009

Wordpress "Cannot modify header information - headers already sent by..." and malicious scripts

Cannot modify header information - headers already sent by...(and its a weird long url that starts above my root folder... whats that about?

UPDATE: This was caused (i think) by having extra whitespace in the function.php file after the last closing php tag. delete all unused lines and spaces in that and you should be fine. good to keep all php files neat and without random whitespaces anyway.

In WP admin panel, on the post page (I think when it autosaves) I get this message. I do not know if it is very bad. Some forums say remove whitespaces after php brackets in functions.php.
I will do that first, because this only began to happen after I began to work on the functions.php file in my child theme folder, and I make messy edits to things, upload to see if it works, and now this error is in the admin panel of my edit post page...
weird, it is either rogue whitespace or something more drastic...
seems to hacve fixed it for now.. havnt got that error in a bit...

IF ITS A MALWARE THING
this details how to remove the problem by reinstalling wordpress, or contacting the webhost

(excerpt, after reinstalling wp folder by folder and checking the actual files on the server...

Check your database for rouge user accounts.

change your admin password for the blog.

check your file and directory permissions

these are all things you need to do.

i think i this link it says what to do like changing the default admin password etc