Support » Fixing WordPress » Headers sent by class-wp-rest-server.php ; blank admin screens; media out

  • Resolved davert318

    (@davert318)


    I had to change the URL of my installation (long irrelevant story). Realizing now this was the wrong approach, I went through the database and changed all the paths and URLs. Everything seems fine but now I am getting blank pages when I try to do some things, and the error in the log:

    [24-Jan-2021 21:35:53 UTC] PHP Warning: Cannot modify header information – headers already sent by (output started at /public_html/wp-content/themes/generatepress/functions.php:1) in /public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1631

    I tried using a different theme; I tried Troubleshooting Mode via the Health Check plugin. DOes not resolve the issue.

    Most annoyingly, the media library appears blank when I try to insert into a post, or anywhere else; but it shows up fine when I look at it by clicking on the Media button in the sidebar.

    Any thoughts on what to do next, other than start over again from backups, which is really unpalatable?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator James Huff

    (@macmanx)

    Volunteer Moderator

    You have unexpected whitespace (either a space or an entire line) on line 1 of the /wp-content/themes/generatepress/functions.php file. See this guide for more info.

    Alternatively, replacing the file with one from a fresh download may resolve the issue.

    Thread Starter davert318

    (@davert318)

    Thanks. I checked for white space… (I went overnight to let my mind clear in case I was doing something really foolish.) Nothing there. I’ll try a new functions file, but I’ve already tried switching themes.

    • This reply was modified 1 year, 6 months ago by davert318.
    Thread Starter davert318

    (@davert318)

    Oops. Replacing functions.php entirely fixed it! The underlying issue was with REST. Thanks!!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Headers sent by class-wp-rest-server.php ; blank admin screens; media out’ is closed to new replies.