WP-CLI
WP-CLI is the command-line interface for WordPress. WPHammer uses WP-CLI extensively behind the scenes — for inventory collection, plugin management, user operations, and more. You can also run WP-CLI commands directly on your sites from the WPHammer interface.
How it works
WP-CLI commands are executed over SSH on the target server. When you run a command:
- WPHammer connects to the server via SSH.
- The command is executed in the context of the site's directory and WordPress installation.
- Output is captured and returned to you in the WPHammer interface.
Commands run as the site's system user, respecting the same file permissions and database access that WordPress itself uses.
Running commands
From the site detail page, you can execute WP-CLI commands directly. Enter the command (without the wp prefix — WPHammer adds it automatically), and the output is displayed in the interface.
Commands are executed as background jobs, so long-running operations do not block your session. The command output and exit status are recorded for review.
Commands used by WPHammer
Many WPHammer features are built on WP-CLI commands:
- Inventory collection —
wp core version,wp plugin list,wp theme listto gather installed software versions - Plugin management —
wp plugin update,wp plugin activate,wp plugin deactivate,wp plugin delete - Theme management —
wp theme update,wp theme activate,wp theme delete - User management —
wp user list,wp user create,wp user update,wp user delete - Magic Login — generates one-time login URLs through a custom WP-CLI command
- Search and Replace —
wp search-replacefor database-wide find-and-replace operations - Site URL —
wp option get siteurlto resolve the site's configured URL - Database info — reads
wp-config.phpvalues to resolve database credentials
Requirements
WP-CLI must be installed and accessible on the server for WordPress management features to work. During server onboarding, WPHammer checks for WP-CLI availability. If it is not installed, onboarding will flag this and some WordPress features will be unavailable until it is set up.
Related
- WordPress Plugins — Plugin management via WP-CLI
- WordPress Users — User management via WP-CLI
- Magic Login — One-click login powered by WP-CLI
- Search & Replace — Database operations via WP-CLI