If you use the command-line and you love WordPress, your life just got easier. We've rolled out WP-CLI to all existing servers.
Of course, when updates to WP-CLI are released, Indichosts.net will also automatically install them on your server.
What Is WP-CLI?
WP-CLI is a command-line tool for developers to manage common tasks (and not so common) of a WordPress installation. It can add/remove users, posts, categories, insert test data, search and replace in the database, reset passwords, help troubleshoot performance issues, and much more!
How to Use WP-CLI
Ready to try it out? Take a look
Frequently used WP-CLI commands
- Check the status of WP-CLI and installed version
WP-CLI Commands A-N
– Open /wp-admin/ in a browser.
– Adds, removes, fetches, and flushes the WP Object Cache object.
– Adds, removes, and lists capabilities of a user role.
– Review current WP-CLI info, check for updates, or see defined aliases.
– Creates, updates, deletes, and moderates comments.
– Generates and reads the wp-config.php file.
– Downloads, installs, updates, and manages a WordPress installation.
– Tests, runs, and deletes WP-Cron events; manages WP-Cron schedules.
– Performs basic database operations using credentials stored in wp-config.php.
– Create a distribution archive based on a project’s .distignore file.
– Inspects oEmbed providers, clears embed cache, and more.
– Executes arbitrary PHP code.
– Loads and executes a PHP file.
– Exports WordPress content to a WXR file.
– Find WordPress installations on the filesystem.
– Get help on WP-CLI, or on a specific command.
– Provides internationalization tools for WordPress projects.
– Imports content from a given WXR file.
– Installs, activates, and manages language packs.
– Imports files as attachments, regenerates thumbnails, or lists registered image sizes.
– Lists, creates, assigns, and deletes the active theme’s navigation menus.
– Perform network-wide operations.
WP-CLI Commands O-Z
– Retrieves and sets site options, including plugin and WordPress settings.
– Lists, installs, and removes WP-CLI packages.
– Manages plugins, including installs, activations, and updates.
– Manages posts, content, and meta.
– Retrieves details on the site’s registered post types.
– Profiles arbitrary code execution, files, key metrics, and stages.
– Lists or flushes the site’s rewrite rules, updates the permalink structure.
– Manages user roles, including creating new roles and resetting to defaults.
– Generates code for post types, taxonomies, plugins, child themes, etc.
– Searches/replaces strings in the database.
– Launches PHP’s built-in web server for a specific WordPress installation.
– Opens an interactive PHP console for running and testing PHP code.
– Lists registered sidebars.
– Creates, deletes, empties, moderates, and lists one or more sites on a multisite installation.
– Lists, adds, or removes super admin users on a multisite installation.
– Retrieves information about registered taxonomies.
– Manages taxonomy terms and term meta, with create, delete, and list commands.
– Manages themes, including installs, activations, and updates.
– Adds, gets, and deletes entries in the WordPress Transient Cache.
– Manages users, along with their roles, capabilities, and meta.
– Manages widgets, including adding and moving them within sidebars.
Working With Plugins and Themes
You can also manage WordPress plugins and themes with WP-CLI commands:
- wp plugin status: Lists all your plugins along with their current active or inactive status.
- wp plugin update restricted-site-access: Updates a single plugin of your choice.
- wp plugin update-all: Updates all your existing plugins.
- wp plugin activate <plugin name>: Activates a particular plugin.
- wp plugin deactivate <plugin name>: Deactivates a particular plugin.
You can also replace plugin
, which allows you to perform similar management of themes.