Skip to main content

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

ItemWhat you needWhy
WordPress rootA known docroot (often /var/www/html)WP-CLI must run in the correct directory
WP-CLIwp available for the web userEnables repeatable installs without GUI
Network accessAccess to WordPress.org (or a ZIP)Needed for downloads
PermissionsWeb 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

PracticeWhy
Install via WP-CLIRepeatable, scriptable, fast
Log versionsMakes rollbacks and audits easier
Activate on staging firstPrevents production surprises
Purge caches after a theme switchOld HTML/CSS can persist with LSCache

Troubleshooting

ProblemCauseFix
Install fails with filesystem errorPermissions or wrong userRun WP-CLI as the web user and verify write access to wp-content/
Theme installs but activation failsWP-CLI path mismatchEnsure you are in the correct docroot and retry
Site looks unchangedCached outputPurge LSCache and test in a private window
Download blockedServer cannot reach WordPress.orgUse the ZIP install workflow on the server

Hands-On

  1. Install GeneratePress on staging.
  2. Confirm active theme slug equals generatepress.
  3. Locate inc/structure/ and list 5 files inside.
  4. 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