Archived topic
PHP Warning: Cannot modify header information
17 replies · Started by Nico on February 8, 2022
Hello dear GeneratePress team!
We just updated a plugin (Yoast) and found the following error message in our Php ErrorLog after the update.
[08-Feb-2022 16:59:02 UTC] PHP Warning: Cannot modify header information - headers already sent in /kunden/469xx_xxx/webseiten/hello-world.net/wordpress/wp-includes/load.php on line 280
Thank you in advance for your help.
Nico
Hi Nico,
It doesn't look like a GP issue to me.
Have you reached out to Yoast support?
Let me know :)
Good evening Ying!
No, we haven't informed Yoast yet. But I will do it now.
Thank you and have a nice evening from Germany
Nico
Thank you Nico, keep us updated :)
Of course :-) Thank you Ying. E-mail to Yoast is already out. feedback follows. 😊
Good morning Ying!
As promised, I am sending you the feedback from Yoast. Since it contains personal data, however, via private message.
We will now work the days through the Yoast ToDo list and inform Yoast of the result. We will also keep you informed if you are interested.
Greetings from Germany to the whole team
Nico
Yes, checking conflicts is important.
Let us know what's the test result :)
Good morning Ying!
Apparently Yoast is not the cause of this error message but Elementor.
We should switch our Elementor page from Elementor Full Width to Elementor Canvas. That should solve the problem.
But I'm not entirely sure if that really caused the problem. What do you mean? Does the explanation make sense?
Greetings from Germany and have a nice weekend
Nico
Hi there,
have you confirmed the issue is Elementor related ? If so you should raise it with there support.
NOTE: switching to Elementor Canvas will remove all Theme elements from the page, so that doesn't sound like a practical solution. If you need a Full Width template and keep the GP Theme elements, then set the Template to Default and set the GP Content Container to Full Width:
Good morning David!
The hint came directly from Elementor Pro Support:
Quote: "...Elementor is trying to rewrite with the new info, while GeneratePress is holding strong and not giving in. Resulting in the PHP error you have. I will suggest you to go to your WordPress Dashboard --> Pages -- > Quick Edit under that page and on Theme, pick Elementor Canvas (this should fix the PHP conflict and not hide the theme header)...".
We had pointed out that we use Generate Press as a theme and that the header and footer on the start page are also generated by GP.
Of course, after following the advice of Elementor Pro Support, the header and footer on our site immediately disappeared.
NOW you know why we are so happy with the support of Gererate Press...
The current state of affairs regarding this error message/warning is that we do not know what is causing it. However, we are trying to continue to monitor the issue.
Send many greetings and wish you a nice rest of the weekend
Nico
P.S:
On February 10th the error/warning was written again to the PhP ErrorLog(during an Elementor update):
[08-Feb-2022 16:59:02 UTC] PHP Warning: Cannot modify header information - headers already sent in /kunden/469xxx_xxx/webseiten/hello-world.net/wordpress/wp-includes/load.php on line 280
[10-Feb-2022 13:23:02 UTC] PHP Warning: Cannot modify header information - headers already sent in /kunden/469xxx_xxx/webseiten/hello-world.net/wordpress/wp-includes/load.php on line 280
In Elementors quote:
Quote: “…Elementor is trying to rewrite with the new info,
Why is Elementor trying to rewrite this ?
In the meantime if you:
a) Quick edit the page and set the Template to default
b) use a Layout Element to set the pages Content Container to Full Width:
https://docs.generatepress.com/article/layout-element-overview/
David, I'm just passing on what Elementor Support said about this error. I neither insisted nor commented on this statement.
I have now set the template of our test page to default and the content container to full width.
http://relaunch.hello-world.net/
The distance from the menu to the hero page is now significantly different compared to our live page
Sorry i was trying to ascertain what the original issue is. Has the PHP Warning gone now with the changes i offered ?
Unfortunately, I can't tell you whether the warnings have disappeared. The warnings do not appear regularly in the error log.
I think the best thing will be if we continue to monitor it and report back to you if the error occurs again.
Ideally you should get on Elementors case to get them to find out why there plugin would cause that. I will leave that up to you :)
To remove the margin between the header and the content on a Full Width container use this CSS:
.full-width-content .entry-content {
margin-top: 0;
}