โ† Back to WP-CLI

WP-CLI Core Commands

Core commands manage the WordPress installation itself โ€” downloading, installing, updating, and verifying the files that power every WordPress site.

These are the commands you run when setting up a new environment, automating deployments, or maintaining production servers.


wp-cli-core โ€” bash

Commands

wp core download

Downloads WordPress core files into the current directory.

wp core download
wp core download --version=6.4.3
wp core download --locale=uk
wp core download --path=/var/www/mysite

Use --version to pin a specific release. Use --locale to download a localized version. Useful when provisioning servers or setting up local environments from scratch.


wp core install

Installs WordPress after the database is configured.

wp core install \
  --url=https://mysite.com \
  --title="My Site" \
  --admin_user=admin \
  --admin_password=secret \
  --admin_email=admin@mysite.com

Requires an existing database and wp-config.php. Run wp config create and wp db create first. A complete WordPress installation from terminal takes under 10 seconds.


wp core multisite-install

Installs a WordPress Multisite network.

wp core multisite-install \
  --url=https://mynetwork.com \
  --title="My Network" \
  --admin_user=admin \
  --admin_email=admin@mynetwork.com

Use this when building multisite networks, SaaS platforms on WordPress, or managing multiple client sites under one installation.


wp core version

Displays the currently installed WordPress version.

wp core version
wp core version --extra

--extra also shows the PHP and MySQL versions. Useful in auditing scripts or when debugging compatibility issues.


wp core check-update

Checks whether a newer WordPress version is available.

wp core check-update

Returns version number, update type (major/minor), and download URL. Commonly used in maintenance scripts before running wp core update.


wp core update

Updates WordPress core to the latest version.

wp core update
wp core update --version=6.5.0
wp core update --minor

--minor restricts updates to minor releases only โ€” safer for production environments. Always run wp db export before updating on production.


wp core update-db

Updates the WordPress database schema after a core update.

wp core update-db
wp core update-db --network

Some WordPress releases include database changes. This command applies them. Use --network on multisite to update all sites in the network at once.


wp core is-installed

Checks whether WordPress is installed in the current directory.

wp core is-installed
wp core is-installed --network

Returns exit code 0 if installed, 1 if not. Useful in shell scripts to conditionally run installation steps.

if ! wp core is-installed; then
  wp core install ...
fi

wp core verify-checksums

Compares core files against official WordPress checksums.

wp core verify-checksums

Detects modified, corrupted, or missing core files. Used during security audits to confirm the installation hasn’t been tampered with. If any file fails the check โ€” investigate before proceeding.


wp core language install

Manages WordPress language packs.

wp core language install uk
wp core language activate uk
wp core language update
wp core language list --status=installed

Useful when deploying multilingual sites or managing localized WordPress environments.


Common Workflows

Deploy a new WordPress site

wp core download
wp config create --dbname=mydb --dbuser=root --dbpass=secret
wp db create
wp core install \
  --url=https://mysite.com \
  --title="My Site" \
  --admin_user=admin \
  --admin_password=secret \
  --admin_email=admin@mysite.com

Full installation from terminal in under a minute.

Maintenance update sequence

wp db export backup-$(date +%Y%m%d).sql
wp core check-update
wp core update
wp core update-db
wp cache flush

Export database first, then update, then flush cache. Safe pattern for production.

Security audit

wp core version
wp core verify-checksums
wp core check-update

Quick three-command check to confirm version, file integrity, and update status.


Related Command Groups

  • Plugins โ€” manage plugins after core is set up
  • Database โ€” export, import, and optimize the database
  • Cache โ€” flush cache after core updates

Practice Cases – coming soon…!