Question

Cannot modify header information

Hi everyone,

I keep getting this error: Warning: Cannot modify header information - headers already sent by (output started at /custom_functions.php:1) in /wp-includes/option.php on line 837

Warning: Cannot modify header information - headers already sent by (output started at /custom_functions.php:1) in /wp-includes/option.php on line 838

Now, I checked my custom-function file, especially line 1 and can’t find anything.

Here it is:

<?php
/* ######################### Begin Registering Custom Widgets ######################### */
// Register the After Single Post widget to display 3 related posts
genesis_register_sidebar( array(
	'id' => 'after-single-post',
	'name' => 'After Single Post',
	'description' => 'Latest 3 posts after comments',
) );
// Register "Top Parallax" widget
genesis_register_sidebar( array(
    'id' => 'top-parallax',
    'name' => __( 'Top Parallax', 'mp' ),
    'description' => __( 'Top Parallax Widget.', 'mp' ),
) );
// Register "About" widget
genesis_register_sidebar( array(

Note: Since my file is long, I just pasted the first few lines.

I would appreciate any help. Note: I can still access my backend and work. But the warning is displayed on top of every page I access.

Frond-end is fine.

This also caused the issue of not being able to login from site.com/wp-admin (which I used to be able to do). When I access this page, it gives me this warning on an otherwise totally white screen:

Warning: Cannot modify header information - headers already sent by (output started at /custom_functions.php:1) in /wp-includes/pluggable.php on line 1210

Thanks in advance.


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hello,

A quick way to fix that would be to enable output_buffering in your php.ini file.

Note that you might have to restart your Apache service after the change.

Hope that this helps! Regards, Bobby