WordPress error: Cannot modify header information

Are you receiving an error similar to this one when logged in to or attempting to log in to your WordPress Admin Dashboard?

Warning: Cannot modify header information – headers already sent by (output started at /domain.com/public_html/wp-content/themes/my-theme/functions.php:179) in /domain.com/public_html/wp-includes/pluggable.php on line 1427

Wordpress error when logging in: Cannot modify header information - headers already sent
Wordpress error when already logged in: Cannot modify header information - headers already sent

The solution is simple. You have empty spaces or line breaks either before or after your <?php ?> tag in the functions.php file. Delete this and the issue should be resolved.

Fix this WordPress error in functions.php: Cannot modify header information - headers already sent