Skip to content

Instantly share code, notes, and snippets.

@asheroto
Created May 2, 2021 03:53
Show Gist options
  • Save asheroto/12ca0524505ec3fe4469aa504b61a084 to your computer and use it in GitHub Desktop.
Save asheroto/12ca0524505ec3fe4469aa504b61a084 to your computer and use it in GitHub Desktop.
WordPress chmod / security - standard recommendations. Run script at the root of the website (where wp-content, wp-config.php, etc is located).
#!/bin/bash
find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;
chmod 755 wp-content;
find wp-content/ -type f -exec chmod 644 {} \;
find wp-includes/ -type f -exec chmod 644 {} \;
mkdir wp-content/uploads; find wp-content/uploads -type f -exec chmod 755 {} \;
chmod 444 wp-config.php;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment