Home›Support›English Support›[Resolved] Warning: Cannot modify header information - headers already sent by
[Resolved] Warning: Cannot modify header information - headers already sent by
This thread is resolved. Here is a description of the problem and solution.
Problem: The client is encountering a 'Cannot modify header information' error in both the admin pages and the Elementor editor of their WordPress site. This issue is related to the WPML plugin and appears to be triggered by specific conditions linked to the client's user account. Solution: 1. We recommend creating a new admin user and deleting the old one to see if this resolves the issue. 2. If the problem persists, consider lowering the PHP version to 8.0 as the current version might be causing compatibility issues with WPML and WordPress. 3. Ensure that the display of errors and warnings is disabled, which is advisable for production sites unless debugging.
If these steps do not resolve the issue or if the solution seems outdated or irrelevant to your case, please visit our known issues page and check for any related updates. We also recommend confirming that you have the latest versions of themes and plugins installed. If the problem continues, do not hesitate to open a new support ticket.
This is the technical support forum for WPML - the multilingual WordPress plugin.
Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.
Background of the issue:
I am trying to resolve an error that appears on both admin pages and in the Elementor editor of my WordPress site, hidden link. The error message is related to the WPML plugin.
Symptoms:
Warning: Cannot modify header information - headers already sent by (output started at /home/istanb10/public_html/oksanataranenko.com/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/wpml/src/UserInterface/Web/Infrastructure/WordPress/CompositionRoot/Config/ExistingPage/PostEditPage.php:23) in /home/istanb10/public_html/oksanataranenko.com/wp-includes/functions.php on line 7144
Questions:
How can I fix the 'Cannot modify header information' error in WPML?
Is there a known issue with WPML causing this error in Elementor?
as agreed I have created a ticket, so please try next:
- Make sure you have a backup.
- Disable all other plugins and leave active only WPML plugins and Elementor
- Switch to WP default theme / hello elementor parent theme
- Check if the issue still happens.
Let me know how it goes and if issue still happens, please share access to staging site so I can check.
Another thing that I realized now is, the same error happens when I go to Elementor Templates. and when I open the Elementor Editor for a page or for an elementor template, the Elementor Editor can not be loaded and I receive an Error like the one in screenshot I am sending with this message.
This is happening when WPML Plugin is active.
When I deactivate WPML Plugin, I can open the Elementor Editor without a problem.
Error message I receive:
Sorry, the content area was not found in your page.
You must call 'the_content' function in the current template, in order for Elementor to work on this page.
As for your 2nd reply, I am not sure if this is related, and since we limit 1 issue per 1 ticket to keep things clear and easier to communicate, lets first check your original issue, and once this is solved if you still have issue we will open new ticket and check that issue.
I am at Pages > All but I do not see related warning message?
Please share steps on how can I check and see that message / issue.
You are in staging.oksanataranenko.com Wp Admin area right ?
When I click on PAGES on the left WP side bar, I am directly getting these error on the top of the page. I am attaching the screenshot. The same errors shows when I click on TEMPLATEs link on the left side bar in WP Admin again.
I think that is a new feature (or at least I realised it now)
So I checked the Structure and Layout of the HELLO THEME SETTINGS and disabled Theme header & Footers and also disabled the PAGE TITLES and I am not getting the errors now anymore. ( Screenshot 1 )
Although, I applied the same setting in my production website (www.oksanataranenko.com) but there I am still getting the same errors..
Both sites have the same plugins active and the same themes are active.. I even tried to default wordpress theme in production website I am still getting the same error. ( Screenshot 2 - Production website )
I am not sure that feature causes and issue with WPML or disabling, it is probably related to something else. Issue did not happen for me on staging as you can see from video I shared.
I am sorry, but I do not have much to suggest from my side, I need to be able to see and check the issue in order to understand what might be causing it and if needs further escalation.
Please try to create new staging site from current production, and check if issue still happens there. If yes, please share URL and I will check it out further.
MY production site is older at the moment than the staging.
I can give credentials for the production website and you can see the error there. How can I share my credentails for thre production website in private messsage ?
you can, but I can not do the debugging there. I need to disable plugins, themes, changes settings and etc, it may break your production website.
If possible please create new staging site, or if not please share a Duplicator copy of your website and I will check it like that. Make sure to exclude large files to keep the package size smaller.
I have created a new staging website. But I couldn't send the login credentials because it was asking for a duplicate package link. Can you please allow me to send a private message so I can share the new staging website credentials."
1) I checked, but I think we are going in circles here, I do not see error message, image attached.
Please try to login with admin account you shared with me, it maybe is related to that, as I do not see any other reason why you have warning message and I do not.
Or share your admin access user account so I can check like that.
I said yes the errors are not seen in Pages when I logged in with the admin account I shared with you, but with the same admin account, when I click on WPML - Translations I am not getting other errors. I get error in some other WPML pages as well.
Please see the screenshot.
I am logged in with the admin account I shared with you.