WP-CLI Core Commands
questions
Answers common questions about installing and deploying WordPress with WP-CLI core commands, including wp core download, wp config create, wp db create, and wp core install. Learn the correct order to run them, when to pin a version, and why WP-CLI beats the web installer.
Can I install WordPress in a subdirectory with WP-CLI?
Yes. Pass the full URL including the path to wp core install –url=. Download and config steps stay the same; only the site URL changes.
Used in
- Deploy a New WordPress Site Practice Case
Can I run wp core install without wp config create?
No. WordPress needs database credentials in wp-config.php before installation. Without config, WP-CLI cannot connect to MySQL and the install will fail.
Used in
- Deploy a New WordPress Site Practice Case
Do I always need wp db create?
Only when the database named in wp-config.php does not exist yet. On shared hosting the database is often pre-created — then skip this step. On local dev, create it with WP-CLI.
Used in
- Deploy a New WordPress Site Practice Case
Should I pin a WordPress version when downloading?
For most installs, use the latest stable release without –version. Pin a version only when you intentionally need parity with production or a legacy environment.
Used in
- Deploy a New WordPress Site Practice Case
What directory should I run wp core download in?
Use an empty directory for a fresh site. WP-CLI downloads core files into the current working directory. Mixing with existing files can leave stale plugins or themes from an old project.
Used in
- Deploy a New WordPress Site Practice Case
What happens if I skip wp db create on a new local site?
wp core install fails because MySQL cannot connect to a database that does not exist. The error looks like a credentials problem but the fix is creating the database first.
Used in
- Deploy a New WordPress Site Practice Case
What is the correct order to deploy WordPress with WP-CLI?
Download core (wp core download), create configuration (wp config create), create the database (wp db create), then install (wp core install). Each step depends on the previous one.
Used in
- Deploy a New WordPress Site Practice Case
Why use WP-CLI instead of the web installer?
WP-CLI is scriptable and repeatable — the same commands work on local, staging, and CI pipelines. No browser clicks, no upload limits, and easy to document as code.
Used in
- Deploy a New WordPress Site Practice Case
Smart FAQ Management
4WP FAQ
Not just another FAQ block. A smart wrapper that adds intelligence
without breaking your design.