Installing GeneratePress
warning
If you run filesystem commands like chown -R or activate themes on production, you can cause downtime. Prefer staging for first-time installs.
Prerequisites
| Item | What you need | Why |
|---|---|---|
| WordPress root | A known docroot (often /var/www/html) | WP-CLI must run in the correct directory |
| WP-CLI | wp available for the web user | Enables repeatable installs without GUI |
| Network access | Access to WordPress.org (or a ZIP) | Needed for downloads |
| Permissions | Web user can write to wp-content/ | Theme installs write to the filesystem |
Safety Notes
- Repeatability: WP-CLI makes installs consistent across environments.
- Auditability: you can log and replay the same commands in automation.
- Speed: you can validate install state without clicking through wp-admin.
How It Works
WP-CLI downloads the theme, unpacks it into wp-content/themes/, then activates it by updating the active theme options.
Step-by-Step Installation
Step 1: Confirm You Are in the WordPress Root
confirm-docroot.sh
cd /var/www/html
wp core is-installed
wp core version
Step 2: Install and Activate GeneratePress
install-generatepress.sh
cd /var/www/html
wp theme install generatepress --activate
Expected output (example):
Installing GeneratePress (latest)...
Theme installed successfully.
Activating 'generatepress'...
Success: Switched to 'GeneratePress' theme.
Step 3: Verify Theme Status
verify-theme-active.sh
cd /var/www/html
wp theme list
wp option get stylesheet
Expected output (example):
generatepress
Step 4: Verify Files on Disk
verify-theme-files.sh
cd /var/www/html
ls -lah wp-content/themes/generatepress | head -n 40
test -f wp-content/themes/generatepress/functions.php && echo "functions.php OK"
test -d wp-content/themes/generatepress/inc && echo "inc/ OK"
Step 5: Optional - Install a Specific Version
install-specific-version.sh
cd /var/www/html
wp theme install generatepress --version=3.4.0 --activate
Optional Configuration
Example: Record the Theme Version for Change Control
record-theme-version.sh
cd /var/www/html
wp theme get generatepress --field=version
Example: Quick Permission Check
check-theme-permissions.sh
cd /var/www/html
stat wp-content/themes/generatepress
caution
Do not run chown -R unless you understand your hosting model. Changing ownership recursively can break deployments and security boundaries.
Best Practices
| Practice | Why |
|---|---|
| Install via WP-CLI | Repeatable, scriptable, fast |
| Log versions | Makes rollbacks and audits easier |
| Activate on staging first | Prevents production surprises |
| Purge caches after a theme switch | Old HTML/CSS can persist with LSCache |
Troubleshooting
| Problem | Cause | Fix |
|---|---|---|
| Install fails with filesystem error | Permissions or wrong user | Run WP-CLI as the web user and verify write access to wp-content/ |
| Theme installs but activation fails | WP-CLI path mismatch | Ensure you are in the correct docroot and retry |
| Site looks unchanged | Cached output | Purge LSCache and test in a private window |
| Download blocked | Server cannot reach WordPress.org | Use the ZIP install workflow on the server |
Hands-On
- Install GeneratePress on staging.
- Confirm active theme slug equals
generatepress. - Locate
inc/structure/and list 5 files inside. - Purge LSCache and confirm the site renders correctly logged-out.
Quick Reference
install-cheatsheet.sh
cd /var/www/html
wp theme install generatepress --activate
wp theme list
wp theme get generatepress --field=version
What's Next
- Next: Installing GP Premium
- Related: Child Theme Setup (overview)