Title: Syntax error in class-wp-rest-posts-controller.php after WordPress update
Last modified: October 1, 2020

---

# Syntax error in class-wp-rest-posts-controller.php after WordPress update

 *  Resolved [santoshskcp](https://wordpress.org/support/users/santoshskcp/)
 * (@santoshskcp)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/syntax-error-in-class-wp-rest-posts-controller-php-after-wordpress-update/)
 * Hi, I was updating my Plugins. Somewhere I started getting “Briefly Unavailable
   for Scheduled Maintenance Error”. But it went away after a while.
 * Then I tried updating my core WordPress from 5.5.1 to the current one. During
   the process the site broke down first with- “Briefly Unavailable for Scheduled
   Maintenance Error” and a few secs later when refreshed it turned to “There has
   been a critical error on your website.”
    Now it says- Parse error: syntax error,
   unexpected end of file in /home/q5h1wtbr7q89/public_html/wp-includes/rest-api/
   endpoints/class-wp-rest-posts-controller.php on line 1624
 * Is this because my core WordPress update failed mid-way and thus left the rest-
   api code only partially updated?
 * WIll manually updating WordPress using FTP resolve this for me?
 * The code leading to error line 1624 is this –
    if ( rest_is_field_included( ‘
   modified_gmt’, $fields ) ) { /* * For drafts, `post_modified_gmt` may not be 
   set (see `post_date_gmt` comments * above). In this case, shim the value based
   on the `post_modified` field * with the site’s timezone offset applied. */ if(‘
   0000-00-00 00:00:00’ === $po
 * As you can see it seems to be left open midway. And I couldn’t make sense of 
   it. Please suggest. I’m not an expert coder. Your suggestions will be of great
   benefit.
 * Before this my site was working perfectly fine.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fsyntax-error-in-class-wp-rest-posts-controller-php-after-wordpress-update%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Moderator [James Huff](https://wordpress.org/support/users/macmanx/)
 * (@macmanx)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/syntax-error-in-class-wp-rest-posts-controller-php-after-wordpress-update/#post-13481628)
 * Try [downloading WordPress](https://wordpress.org/download/) again, access your
   server via [SFTP or FTP](https://wordpress.org/support/article/ftp-clients/),
   or a file manager in your hosting account’s control panel (consult your hosting
   provider’s documentation for specifics on these), and delete then replace your
   copies of everything on the server **except** the wp-config.php file and the /
   wp-content/ directory with fresh copies from the download. This will effectively
   replace all of your core files without damaging your content and settings.
 * Some uploaders tend to be unreliable when overwriting files, so don’t forget 
   to delete the original files before replacing them.
 *  Thread Starter [santoshskcp](https://wordpress.org/support/users/santoshskcp/)
 * (@santoshskcp)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/syntax-error-in-class-wp-rest-posts-controller-php-after-wordpress-update/#post-13484442)
 * Thank you. That worked perfectly! The website is back. Saved me a lot of work.
   Thanks a lot.
 * Just to be sure, some [tutorials](https://wordpress.org/support/article/ftp-clients/)
   state that- “Upload the individual files from the new wp-content folder to your
   existing wp-content folder and overwrite existing files.”
 * But following your instructions above- I didn’t update the wp-content directory
   at all.
 * That is totally fine and shouldn’t be an issue right?
 *  Moderator [James Huff](https://wordpress.org/support/users/macmanx/)
 * (@macmanx)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/syntax-error-in-class-wp-rest-posts-controller-php-after-wordpress-update/#post-13485139)
 * That’s totally fine. wp-content only contains your uploads, plugins, and themes.
 * Since that’s all individual to you and your site, there isn’t much to replace
   from a fresh WordPress download, and replacing those things wouldn’t make much
   of a difference anyway.
 *  Thread Starter [santoshskcp](https://wordpress.org/support/users/santoshskcp/)
 * (@santoshskcp)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/syntax-error-in-class-wp-rest-posts-controller-php-after-wordpress-update/#post-13485165)
 * Understood. Thanks again. Very much appreciated.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Syntax error in class-wp-rest-posts-controller.php after WordPress update’
is closed to new replies.

## Tags

 * [critical error](https://wordpress.org/support/topic-tag/critical-error/)
 * [syntax error](https://wordpress.org/support/topic-tag/syntax-error/)
 * [WordPress update](https://wordpress.org/support/topic-tag/wordpress-update/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 2 participants
 * Last reply from: [santoshskcp](https://wordpress.org/support/users/santoshskcp/)
 * Last activity: [5 years, 8 months ago](https://wordpress.org/support/topic/syntax-error-in-class-wp-rest-posts-controller-php-after-wordpress-update/#post-13485165)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
