WordPress Help

Official documentation, learning resources, and contributor guides collected from WordPress.org.

  • WP_CLI::colorize()

    Colorize a string for output. Usage WP_CLI::colorize( $string ) $string (string) String to colorize for output, with color tokens. @return (string) string. Notes Yes, you can change the color of command line text too. For instance, here’s how WP_CLI::success() colorizes “Success: ” WP_CLI::colorize( “%GSuccess:%n ” ) Uses \cli\Colors::colorize() to transform color tokens to display settings.…

    Read guide

  • WP_CLI::confirm()

    Ask for confirmation before running a destructive operation. Usage WP_CLI::confirm( $question, $assoc_args = [] ) $question (string) Question to display before the prompt. $assoc_args (array) Skips prompt if ‘yes’ is provided. Notes If ‘y’ is provided to the question, the script execution continues. If ‘n’ or any other response is provided to the question, script…

    Read guide

  • How to start the webserver

    You can use the command wp server to launches PHP’s built-in web server for a specific WordPress installation. By default, the webserver will start using the localhost and default port 8080 but, you can change them using the –host and –port options. Step 1 – Start the web server using the default settings $ wp…

    Read guide

  • Internal API

    WP-CLI includes a number of utilities which are considered stable and meant to be used by commands. This also means functions and methods not listed here are considered part of the private API. They may change or disappear at any time. Internal API documentation is generated from the WP-CLI codebase on every release. To suggest…

    Read guide

  • WP-CLI Hack Day

    Welcome to WP-CLI Hack Day! We appreciate you taking time to contribute to the project. We’d love to help you submit at least one pull request today. Given this goal, you’ll likely want to start with something small and attainable. After you’ve submitted your first pull request for the day, you’re welcome to work on…

    Read guide

  • Installing

    Requirements WP-CLI requires PHP 7.2.24 or later. To check the version of PHP available on your system, run: php –version WP-CLI has no additional requirements beyond those of WordPress itself. Recommended installation The recommended way to install WP-CLI is by downloading the Phar build (archives similar to Java JAR files, see this article for more…

    Read guide

  • How to WP-CLI

    Introduction Using WP-CLI, you can perform specific tasks using the command line instead of accessing the WordPress admin panel. In the following section, we will cover step by step some of these tasks. How-to install WordPress How to put the website in maintenance mode How-to start the webserver How to create a custom plugin Figure…

    Read guide

  • Hosting Companies

    The following is a list of hosting companies that have WP-CLI installed by default for their customers, i.e. when they first SSH into their server, the wp command is already available. In alphabetical order: 2020Media 20i 34SP.com A2 Hosting Alldomains.Hosting Altis Cloud Platform AltusHost Amimoto BigCloudy Bluehost Cyberfusion Hypernode CloudHostWorld Cloudways Convesio Curanet D9 Hosting…

    Read guide

  • Identify a Plugin or Theme Conflict

    Is WP-CLI not working with your WordPress install, but you don’t know why? It might be a plugin or theme conflicting with the WP-CLI load process. To verify, first run wp –skip-plugins –skip-themes to execute WP-CLI without loading plugins or themes. If WP-CLI runs as expected with plugins and themes skipped, then the problem is…

    Read guide

  • Implementation Details

    This page contains some history on various implementation details of WP-CLI. Bootstrapping WordPress On a normal web request, your web server calls the index.php file in the root of the web directory to bootstrap the WordPress load process: <?php /** * Front to the WordPress application. This file doesn’t do anything, but loads * wp-blog-header.php…

    Read guide