WordPress - Header May Not Contain More Than a Single Header

The following error is caused by a space after the site or home URL in the WordPress database:

Warning: Header may not contain more than a single header, new line detected.

To fix this error, you can make changes to the site or home URL from within the WordPress Dashboard or through the WordPress installation's database.

Fix URLs within the WordPress Dashboard (Recommended)

To fix the home and site URLs from within the WordPress Dashboard:

  1. Log into your WordPress Dashboard.
  2. In the left-hand menu, go to Settings > General.
  3. In the WordPress address (URL) and Site address (URL) fields, make sure there are no spaces after the URLs .
  4. Click Save Changes.

Fix URLs within phpMyAdmin

Option 1: Manually Edit Database

To manually edit the site and home URLs within your WordPress database:

  1. Log into cPanel.
  2. In the Databases section, click on the phpMyAdmin icon.
  3. From the left menu, select the database for your WordPress installation.
  4. From the left menu, select wp_options.
  5. Find and edit the records for siteurl and home, ensuring that there are no spaces after the domain name.

Option 2: Run an SQL Query

As an alternative to manually editing the database as described above, you can run an SQL query in phpMyAdmin to update both fields (site and home) at one time. To do this:

  1. Log into cPanel.
  2. In the Databases section, click on the phpMyAdmin icon.
  3. From the left menu, select the database for your WordPress installation.
  4. From the top menu, click on the SQL tab.
  5. In the text box, enter the following query, replacing www.domain.com with your domain:
    UPDATE `wp_options` SET option_value='http://www.domain.com' WHERE option_name='siteurl' OR option_name='home';
  6. Click Go.