Title: WP Update with Hardening
Last modified: November 27, 2019

---

# WP Update with Hardening

 *  [lordandy1984](https://wordpress.org/support/users/lordandy1984/)
 * (@lordandy1984)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/wp-update-with-hardening/)
 * Hi,
 * in my setup, I usually follow the file permission guidelines on [hardening-wordpress](https://wordpress.org/support/article/hardening-wordpress/#changing-file-permissions)
 * This means, only the wp-content folder is writable by the webserver/PHP, all 
   other files are just writable by the SSH/SFTP user and the PHP process can read
   them.
 * This is good for daily life, plugins or malicious code cannot access wordpress
   core files to write to them.
 * Nevertheless, for a core update write permissions are needed, so I just run a
   `
   chown -R www-data /var/www/web01`. Then I do the update, and I run a `chown -
   R web01 /var/www/web01` `chmod -R g+w /var/www/web01/wp-content` afterwards.
 * This gets annoying having more and more sites to manage. Is there any hook I 
   can use to write my own plugin which just issues those commands before/after 
   the wordpress update?
 * Or is there any other idea how you handle WP core updates with hardened file 
   permissions?
 * Cheers,
    Andy

Viewing 1 replies (of 1 total)

 *  Moderator [James Huff](https://wordpress.org/support/users/macmanx/)
 * (@macmanx)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/wp-update-with-hardening/#post-12182509)
 * Hm, you shouldn’t need to do that, see: [https://wordpress.org/support/article/hardening-wordpress/#regarding-automatic-updates](https://wordpress.org/support/article/hardening-wordpress/#regarding-automatic-updates)
 * Make sure that you have PHP configured to run as the user that owns the files,
   not the entire server’s user.

Viewing 1 replies (of 1 total)

The topic ‘WP Update with Hardening’ is closed to new replies.

## Tags

 * [hardening](https://wordpress.org/support/topic-tag/hardening/)
 * [permissions](https://wordpress.org/support/topic-tag/permissions/)
 * [update](https://wordpress.org/support/topic-tag/update/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [James Huff](https://wordpress.org/support/users/macmanx/)
 * Last activity: [6 years, 5 months ago](https://wordpress.org/support/topic/wp-update-with-hardening/#post-12182509)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
