Mobile app version of vmapp.org
Login or Join
Shakeerah822

: "Cannot modify header information" error in my PHP/WordPress site I edited the header.php and functions.php files in my WordPress site to add Google Analytics tracking code. Now, when I try to

@Shakeerah822

Posted in: #HttpHeaders #Php #Wordpress

I edited the header.php and functions.php files in my WordPress site to add Google Analytics tracking code. Now, when I try to login to my admin area, the following warning appears and I am unable to login to my WordPress account:


Warning:

Cannot modify header information - headers already sent by (output
started at
/home/wwwwww/public_html/wp-content/themes/poker-complex/functions.php:11)
in /home/wwwwww/public_html/wp-includes/pluggable.php on line 934


How to solve this problem?

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Shakeerah822

2 Comments

Sorted by latest first Latest Oldest Best

 

@Samaraweera270

Also remove the UTF BOM (Byte Order Mark). AFAIK PHP doesn't support UTF BOM on its files, and to send utf-8 code the best way is adding headers like this one:

<?php
header("Content-Type: text/html; charset=utf-8");
?>


and also metadata

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

10% popularity Vote Up Vote Down


 

@Heady270

Remove all white space (spaces and carriage returns) before any opening <?php or <? tags and after all closing ?> tags in all PHP files you've modified.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme