├── .github ├── CODEOWNERS └── workflows │ └── code-quality.yml ├── .gitignore ├── LICENSE ├── README.md ├── behat-steps.md ├── behat-steps ├── given-a-custom-wp-content-directory.md ├── given-a-database.md ├── given-a-dependency-on-current-wp-cli.md ├── given-a-downloaded-phar-with-the-same-version-version.md ├── given-a-misconfigured-wp-content-dir-constant-directory.md ├── given-a-new-phar-with-the-same-version-version.md ├── given-a-php-built-in-web-server-to-serve-subdir.md ├── given-a-php-built-in-web-server.md ├── given-a-wp-installation-in-subdir.md ├── given-a-wp-installation-with-composer-and-a-custom-vendor-directory-vendor-directory.md ├── given-a-wp-installation-with-composer.md ├── given-a-wp-installation.md ├── given-a-wp-multisite-subdirectory-subdomaininstall-installation.md ├── given-an-empty-cache.md ├── given-an-empty-directory.md ├── given-an-empty-non-existent-directory.md ├── given-an-file-cache-file.md ├── given-download.md ├── given-replaced-with-in-the-file.md ├── given-save-stdout-stderr-as.md ├── given-save-the-file-as.md ├── given-that-http-requests-to-will-respond-with.md ├── given-these-installed-and-active-plugins.md ├── given-wp-config-php.md ├── given-wp-files.md ├── then-an-email-should-be-sent-not-be-sent.md ├── then-stdout-should-be-a-json-array-containing.md ├── then-stdout-should-be-a-table-containing-rows.md ├── then-stdout-should-be-csv-containing.md ├── then-stdout-should-be-json-containing.md ├── then-stdout-should-be-yaml-containing.md ├── then-stdout-should-end-with-a-table-containing-rows.md ├── then-stdout-stderr-should-be-a-number.md ├── then-stdout-stderr-should-be-a-version-string-w.md ├── then-stdout-stderr-should-be-empty.md ├── then-stdout-stderr-should-not-be-a-number.md ├── then-stdout-stderr-should-not-be-empty.md ├── then-stdout-stderr-should-not-match.md ├── then-stdout-stderr-should-strictly-be-contain-not-contain.md ├── then-the-contents-of-the-file-should-not-match.md ├── then-the-file-directory-should-strictly-exist-not-exist-be-contain-not-contain.md ├── then-the-http-status-code-should-be-code.md ├── then-the-return-code-should-not-be.md ├── when-i-launch-in-the-background.md ├── when-i-run-try-from.md ├── when-i-run-try-the-previous-command-again.md └── when-i-run-try.md ├── bin ├── command.php ├── commands-manifest.json ├── handbook-manifest.json ├── install_packages.sh └── templates │ ├── behat-steps-list.mustache │ ├── behat-steps.mustache │ ├── internal-api-list.mustache │ ├── internal-api.mustache │ └── subcmd-list.mustache ├── bug-reports.md ├── code-review.md ├── commands-cookbook.md ├── commands ├── admin.md ├── cache.md ├── cache │ ├── add.md │ ├── decr.md │ ├── delete.md │ ├── flush-group.md │ ├── flush.md │ ├── get.md │ ├── incr.md │ ├── patch.md │ ├── pluck.md │ ├── replace.md │ ├── set.md │ ├── supports.md │ └── type.md ├── cap.md ├── cap │ ├── add.md │ ├── list.md │ └── remove.md ├── cli.md ├── cli │ ├── alias.md │ ├── alias │ │ ├── add.md │ │ ├── delete.md │ │ ├── get.md │ │ ├── is-group.md │ │ ├── list.md │ │ └── update.md │ ├── cache.md │ ├── cache │ │ ├── clear.md │ │ └── prune.md │ ├── check-update.md │ ├── cmd-dump.md │ ├── completions.md │ ├── has-command.md │ ├── info.md │ ├── param-dump.md │ ├── update.md │ └── version.md ├── comment.md ├── comment │ ├── approve.md │ ├── count.md │ ├── create.md │ ├── delete.md │ ├── exists.md │ ├── generate.md │ ├── get.md │ ├── list.md │ ├── meta.md │ ├── meta │ │ ├── add.md │ │ ├── delete.md │ │ ├── get.md │ │ ├── list.md │ │ ├── patch.md │ │ ├── pluck.md │ │ └── update.md │ ├── recount.md │ ├── spam.md │ ├── status.md │ ├── trash.md │ ├── unapprove.md │ ├── unspam.md │ ├── untrash.md │ └── update.md ├── config.md ├── config │ ├── create.md │ ├── delete.md │ ├── edit.md │ ├── get.md │ ├── has.md │ ├── is-true.md │ ├── list.md │ ├── path.md │ ├── set.md │ └── shuffle-salts.md ├── core.md ├── core │ ├── check-update.md │ ├── download.md │ ├── install.md │ ├── is-installed.md │ ├── multisite-convert.md │ ├── multisite-install.md │ ├── update-db.md │ ├── update.md │ ├── verify-checksums.md │ └── version.md ├── cron.md ├── cron │ ├── event.md │ ├── event │ │ ├── delete.md │ │ ├── list.md │ │ ├── run.md │ │ ├── schedule.md │ │ └── unschedule.md │ ├── schedule.md │ ├── schedule │ │ └── list.md │ └── test.md ├── db.md ├── db │ ├── check.md │ ├── clean.md │ ├── cli.md │ ├── columns.md │ ├── create.md │ ├── drop.md │ ├── export.md │ ├── import.md │ ├── optimize.md │ ├── prefix.md │ ├── query.md │ ├── repair.md │ ├── reset.md │ ├── search.md │ ├── size.md │ └── tables.md ├── dist-archive.md ├── embed.md ├── embed │ ├── cache.md │ ├── cache │ │ ├── clear.md │ │ ├── find.md │ │ └── trigger.md │ ├── fetch.md │ ├── handler.md │ ├── handler │ │ └── list.md │ ├── provider.md │ └── provider │ │ ├── list.md │ │ └── match.md ├── eval-file.md ├── eval.md ├── export.md ├── find.md ├── help.md ├── i18n.md ├── i18n │ ├── make-json.md │ ├── make-mo.md │ ├── make-php.md │ ├── make-pot.md │ └── update-po.md ├── import.md ├── language.md ├── language │ ├── core.md │ ├── core │ │ ├── activate.md │ │ ├── install.md │ │ ├── is-installed.md │ │ ├── list.md │ │ ├── uninstall.md │ │ └── update.md │ ├── plugin.md │ ├── plugin │ │ ├── install.md │ │ ├── is-installed.md │ │ ├── list.md │ │ ├── uninstall.md │ │ └── update.md │ ├── theme.md │ └── theme │ │ ├── install.md │ │ ├── is-installed.md │ │ ├── list.md │ │ ├── uninstall.md │ │ └── update.md ├── maintenance-mode.md ├── maintenance-mode │ ├── activate.md │ ├── deactivate.md │ ├── is-active.md │ └── status.md ├── media.md ├── media │ ├── fix-orientation.md │ ├── image-size.md │ ├── import.md │ └── regenerate.md ├── menu.md ├── menu │ ├── create.md │ ├── delete.md │ ├── item.md │ ├── item │ │ ├── add-custom.md │ │ ├── add-post.md │ │ ├── add-term.md │ │ ├── delete.md │ │ ├── list.md │ │ └── update.md │ ├── list.md │ ├── location.md │ └── location │ │ ├── assign.md │ │ ├── list.md │ │ └── remove.md ├── network.md ├── network │ ├── meta.md │ └── meta │ │ ├── add.md │ │ ├── delete.md │ │ ├── get.md │ │ ├── list.md │ │ ├── patch.md │ │ ├── pluck.md │ │ └── update.md ├── option.md ├── option │ ├── add.md │ ├── delete.md │ ├── get-autoload.md │ ├── get.md │ ├── list.md │ ├── patch.md │ ├── pluck.md │ ├── set-autoload.md │ └── update.md ├── package.md ├── package │ ├── browse.md │ ├── install.md │ ├── list.md │ ├── path.md │ ├── uninstall.md │ └── update.md ├── plugin.md ├── plugin │ ├── activate.md │ ├── auto-updates.md │ ├── auto-updates │ │ ├── disable.md │ │ ├── enable.md │ │ └── status.md │ ├── deactivate.md │ ├── delete.md │ ├── get.md │ ├── install.md │ ├── is-active.md │ ├── is-installed.md │ ├── list.md │ ├── path.md │ ├── search.md │ ├── status.md │ ├── toggle.md │ ├── uninstall.md │ ├── update.md │ └── verify-checksums.md ├── post-type.md ├── post-type │ ├── get.md │ └── list.md ├── post.md ├── post │ ├── create.md │ ├── delete.md │ ├── edit.md │ ├── exists.md │ ├── generate.md │ ├── get.md │ ├── list.md │ ├── meta.md │ ├── meta │ │ ├── add.md │ │ ├── clean-duplicates.md │ │ ├── delete.md │ │ ├── get.md │ │ ├── list.md │ │ ├── patch.md │ │ ├── pluck.md │ │ └── update.md │ ├── term.md │ ├── term │ │ ├── add.md │ │ ├── list.md │ │ ├── remove.md │ │ └── set.md │ ├── update.md │ └── url-to-id.md ├── profile.md ├── profile │ ├── eval-file.md │ ├── eval.md │ ├── hook.md │ └── stage.md ├── rewrite.md ├── rewrite │ ├── flush.md │ ├── list.md │ └── structure.md ├── role.md ├── role │ ├── create.md │ ├── delete.md │ ├── exists.md │ ├── list.md │ └── reset.md ├── scaffold.md ├── scaffold │ ├── block.md │ ├── child-theme.md │ ├── plugin-tests.md │ ├── plugin.md │ ├── post-type.md │ ├── taxonomy.md │ ├── theme-tests.md │ └── underscores.md ├── search-replace.md ├── server.md ├── shell.md ├── sidebar.md ├── sidebar │ └── list.md ├── site.md ├── site │ ├── activate.md │ ├── archive.md │ ├── create.md │ ├── deactivate.md │ ├── delete.md │ ├── empty.md │ ├── generate.md │ ├── list.md │ ├── mature.md │ ├── meta.md │ ├── meta │ │ ├── add.md │ │ ├── delete.md │ │ ├── get.md │ │ ├── list.md │ │ ├── patch.md │ │ ├── pluck.md │ │ └── update.md │ ├── option.md │ ├── option │ │ ├── add.md │ │ ├── delete.md │ │ ├── get.md │ │ ├── list.md │ │ ├── patch.md │ │ ├── pluck.md │ │ └── update.md │ ├── private.md │ ├── public.md │ ├── spam.md │ ├── switch-language.md │ ├── unarchive.md │ ├── unmature.md │ └── unspam.md ├── super-admin.md ├── super-admin │ ├── add.md │ ├── list.md │ └── remove.md ├── taxonomy.md ├── taxonomy │ ├── get.md │ └── list.md ├── term.md ├── term │ ├── create.md │ ├── delete.md │ ├── generate.md │ ├── get.md │ ├── list.md │ ├── meta.md │ ├── meta │ │ ├── add.md │ │ ├── delete.md │ │ ├── get.md │ │ ├── list.md │ │ ├── patch.md │ │ ├── pluck.md │ │ └── update.md │ ├── migrate.md │ ├── recount.md │ └── update.md ├── theme.md ├── theme │ ├── activate.md │ ├── auto-updates.md │ ├── auto-updates │ │ ├── disable.md │ │ ├── enable.md │ │ └── status.md │ ├── delete.md │ ├── disable.md │ ├── enable.md │ ├── get.md │ ├── install.md │ ├── is-active.md │ ├── is-installed.md │ ├── list.md │ ├── mod.md │ ├── mod │ │ ├── get.md │ │ ├── list.md │ │ ├── remove.md │ │ └── set.md │ ├── path.md │ ├── search.md │ ├── status.md │ └── update.md ├── transient.md ├── transient │ ├── delete.md │ ├── get.md │ ├── list.md │ ├── patch.md │ ├── pluck.md │ ├── set.md │ └── type.md ├── user.md ├── user │ ├── add-cap.md │ ├── add-role.md │ ├── application-password.md │ ├── application-password │ │ ├── create.md │ │ ├── delete.md │ │ ├── exists.md │ │ ├── get.md │ │ ├── list.md │ │ ├── record-usage.md │ │ └── update.md │ ├── check-password.md │ ├── create.md │ ├── delete.md │ ├── exists.md │ ├── generate.md │ ├── get.md │ ├── import-csv.md │ ├── list-caps.md │ ├── list.md │ ├── meta.md │ ├── meta │ │ ├── add.md │ │ ├── delete.md │ │ ├── get.md │ │ ├── list.md │ │ ├── patch.md │ │ ├── pluck.md │ │ └── update.md │ ├── remove-cap.md │ ├── remove-role.md │ ├── reset-password.md │ ├── session.md │ ├── session │ │ ├── destroy.md │ │ └── list.md │ ├── set-role.md │ ├── signup.md │ ├── signup │ │ ├── activate.md │ │ ├── delete.md │ │ ├── get.md │ │ └── list.md │ ├── spam.md │ ├── term.md │ ├── term │ │ ├── add.md │ │ ├── list.md │ │ ├── remove.md │ │ └── set.md │ ├── unspam.md │ └── update.md ├── widget.md └── widget │ ├── add.md │ ├── deactivate.md │ ├── delete.md │ ├── list.md │ ├── move.md │ ├── reset.md │ └── update.md ├── committers-credo.md ├── common-issues.md ├── composer.json ├── config.md ├── contributing.md ├── contributor-day.md ├── doctor-check-constant-value.md ├── doctor-check-file-contents.md ├── doctor-check-option-value.md ├── doctor-check-plugin-status.md ├── doctor-customize-config.md ├── doctor-default-checks.md ├── doctor-write-custom-check.md ├── doctor.md ├── documentation-standards.md ├── external-resources.md ├── force-output-specific-locale.md ├── governance.md ├── hack-day.md ├── hosting-companies.md ├── how-to-create-custom-plugins.md ├── how-to-install.md ├── how-to-maintenance-mode.md ├── how-to-start-webserver.md ├── how-to.md ├── identify-plugin-theme-conflict.md ├── implementation-details.md ├── index.md ├── installing.md ├── internal-api.md ├── internal-api ├── wp-cli-add-command.md ├── wp-cli-add-hook.md ├── wp-cli-add-wp-hook.md ├── wp-cli-colorize.md ├── wp-cli-confirm.md ├── wp-cli-debug.md ├── wp-cli-do-hook.md ├── wp-cli-error-multi-line.md ├── wp-cli-error.md ├── wp-cli-get-config.md ├── wp-cli-get-php-binary.md ├── wp-cli-halt.md ├── wp-cli-has-config.md ├── wp-cli-launch-self.md ├── wp-cli-launch.md ├── wp-cli-line.md ├── wp-cli-log.md ├── wp-cli-read-value.md ├── wp-cli-run-command.md ├── wp-cli-runcommand.md ├── wp-cli-success.md ├── wp-cli-utils-basename.md ├── wp-cli-utils-esc-like.md ├── wp-cli-utils-format-items.md ├── wp-cli-utils-get-flag-value.md ├── wp-cli-utils-get-home-dir.md ├── wp-cli-utils-get-named-sem-ver.md ├── wp-cli-utils-get-php-binary.md ├── wp-cli-utils-get-temp-dir.md ├── wp-cli-utils-http-request.md ├── wp-cli-utils-ispiped.md ├── wp-cli-utils-launch-editor-for-input.md ├── wp-cli-utils-make-progress-bar.md ├── wp-cli-utils-normalize-path.md ├── wp-cli-utils-parse-ssh-url.md ├── wp-cli-utils-parse-str-to-argv.md ├── wp-cli-utils-proc-open-compat.md ├── wp-cli-utils-report-batch-operation-results.md ├── wp-cli-utils-trailingslashit.md ├── wp-cli-utils-write-csv.md └── wp-cli-warning.md ├── philosophy.md ├── phpcs.xml.dist ├── plugin-unit-tests.md ├── pull-requests.md ├── quick-start.md ├── release-checklist.md ├── repository-management.md ├── roadmap.md ├── running-commands-remotely.md ├── sharing-wp-cli-packages.md ├── shell-friends.md ├── tools.md ├── troubleshooting.md └── wp-cli.yml /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @wp-cli/committers 2 | -------------------------------------------------------------------------------- /.github/workflows/code-quality.yml: -------------------------------------------------------------------------------- 1 | name: Code Quality Checks 2 | 3 | on: 4 | pull_request: 5 | push: 6 | branches: 7 | - main 8 | - master 9 | 10 | jobs: 11 | code-quality: 12 | uses: wp-cli/.github/.github/workflows/reusable-code-quality.yml@main 13 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | _site 2 | .DS_Store 3 | Gemfile.lock 4 | composer.lock 5 | vendor 6 | _drafts/ 7 | bin/packages 8 | .*.swp 9 | commands/doctor* 10 | commands/google-sitemap* 11 | commands/maintenance* 12 | commands/super-cache* 13 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (C) 2012-2022 WP-CLI Development Group (https://github.com/wp-cli/handbook/contributors) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | wp-cli/handbook 2 | =============== 3 | 4 | These files comprise the WP-CLI handbook ([make.wordpress.org/cli/handbook](https://make.wordpress.org/cli/handbook/)) and WP-CLI commands directory ([developer.wordpress.org/cli/commands](https://developer.wordpress.org/cli/commands/)). 5 | 6 | The documentation is located in GitHub to enable a pull request-based editing workflow. 7 | 8 | Long-form documentation (e.g. "Commands cookbook") can be edited directly. 9 | 10 | Internal API docs and command pages are generated dynamically from the WP-CLI codebase using the `wp handbook` series of commands. 11 | 12 | Before running these commands the bash script `bin/install-packages.sh` should be run to install the latest versions of the non-bundled commands in `bin/packages`. Note `wp` must point to the target WP-CLI instance, i.e. the phar/git that contains the docblocks to be generated against, and should be run with `WP_CLI_PACKAGES_DIR=bin/packages` and `WP_CLI_CONFIG_PATH=/dev/null`. 13 | 14 | So for instance to generate all dynamically created documentation against the nightly phar run: 15 | 16 | ``` 17 | wp cli update --nightly 18 | bin/install_packages.sh 19 | WP_CLI_PACKAGES_DIR=bin/packages WP_CLI_CONFIG_PATH=/dev/null wp handbook gen-all 20 | ``` 21 | 22 | All documentation is imported automatically into WordPress.org in a two step process: 23 | 24 | 1. WordPress reads `commands-manifest.json` or `handbook-manifest.json` to understand all pages that need to be created. 25 | 2. Each WordPress page has a `markdown_source` attribute specifying a Markdown file to be fetched, converted to HTML, and saved in the database. 26 | 27 | For make.wordpress.org/cli, the import process is a [WordPress plugin](https://meta.trac.wordpress.org/browser/sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-cli/inc/class-markdown-import.php) running a WP Cron job every 15 minutes. For developer.wordpress.org/cli, this is a [class in the devhub theme](https://meta.trac.wordpress.org/browser/sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/cli.php) running a WP Cron job every 12 hours. 28 | -------------------------------------------------------------------------------- /behat-steps/when-i-launch-in-the-background.md: -------------------------------------------------------------------------------- 1 | # When /^I launch in the background `([^`]+)`$/ 2 | 3 | Launch a given command in the background. 4 | 5 | 6 | *** 7 | 8 | ## Usage 9 | 10 | ``` 11 | Scenario: My example scenario 12 | Given a WP install 13 | And I launch in the background `wp server --host=localhost --port=8181` 14 | ... 15 | ``` 16 | 17 | 18 | *Behat steps documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please submit a pull request.* 19 | 20 | 21 | *** 22 | 23 | ## Related 24 | 25 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /behat-steps/when-i-run-try-from.md: -------------------------------------------------------------------------------- 1 | # When /^I (run|try) `([^`]+)` from '([^\s]+)'$/ 2 | 3 | Run or try a given command in a subdirectory. 4 | 5 | 6 | *** 7 | 8 | ## Usage 9 | 10 | `run` expects an exit code 0, whereas `try` allows for non-zero exit codes. 11 | 12 | ``` 13 | Scenario: My example scenario 14 | When I run `wp core is-installed` 15 | Then STDOUT should be empty 16 | 17 | When I run `wp core is-installed` from 'foo/wp-content' 18 | Then STDOUT should be empty 19 | ``` 20 | 21 | 22 | *Behat steps documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please submit a pull request.* 23 | 24 | 25 | *** 26 | 27 | ## Related 28 | 29 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /behat-steps/when-i-run-try-the-previous-command-again.md: -------------------------------------------------------------------------------- 1 | # When /^I (run|try) the previous command again$/ 2 | 3 | Run or try the previous command again. 4 | 5 | 6 | *** 7 | 8 | ## Usage 9 | 10 | `run` expects an exit code 0, whereas `try` allows for non-zero exit codes. 11 | 12 | ``` 13 | Scenario: My example scenario 14 | When I run `wp site option update admin_user_id 1` 15 | Then STDOUT should contain: 16 | """ 17 | Success: Updated 'admin_user_id' site option. 18 | """ 19 | 20 | When I run the previous command again 21 | Then STDOUT should contain: 22 | """ 23 | Success: Value passed for 'admin_user_id' site option is unchanged. 24 | """ 25 | ``` 26 | 27 | 28 | *Behat steps documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please submit a pull request.* 29 | 30 | 31 | *** 32 | 33 | ## Related 34 | 35 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /behat-steps/when-i-run-try.md: -------------------------------------------------------------------------------- 1 | # When /^I (run|try) `([^`]+)`$/ 2 | 3 | Run or try a given command. 4 | 5 | 6 | *** 7 | 8 | ## Usage 9 | 10 | `run` expects an exit code 0, whereas `try` allows for non-zero exit codes. 11 | 12 | So if using `run` and the command errors, the step will fail. 13 | 14 | ``` 15 | Scenario: My example scenario 16 | When I run `wp core version` 17 | Then STDOUT should contain: 18 | """ 19 | 6.8 20 | """ 21 | 22 | Scenario: My other scenario 23 | When I try `wp i18n make-pot foo bar/baz.pot` 24 | Then STDERR should contain: 25 | """ 26 | Error: Not a valid source directory. 27 | """ 28 | And the return code should be 1 29 | ``` 30 | 31 | 32 | *Behat steps documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please submit a pull request.* 33 | 34 | 35 | *** 36 | 37 | ## Related 38 | 39 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /bin/install_packages.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Installs the 4 non-bundled packages in `bin/packages`. To be run before using the `wp handbook` commands. 4 | 5 | WP_CLI_PACKAGES_DIR=bin/packages WP_CLI_CONFIG_PATH=/dev/null wp package install wp-cli/admin-command 6 | WP_CLI_PACKAGES_DIR=bin/packages WP_CLI_CONFIG_PATH=/dev/null wp package install wp-cli/find-command 7 | WP_CLI_PACKAGES_DIR=bin/packages WP_CLI_CONFIG_PATH=/dev/null wp package install wp-cli/profile-command 8 | WP_CLI_PACKAGES_DIR=bin/packages WP_CLI_CONFIG_PATH=/dev/null wp package install wp-cli/dist-archive-command 9 | -------------------------------------------------------------------------------- /bin/templates/behat-steps-list.mustache: -------------------------------------------------------------------------------- 1 | 10 | -------------------------------------------------------------------------------- /bin/templates/behat-steps.mustache: -------------------------------------------------------------------------------- 1 | # {{full_name}} 2 | 3 | {{phpdoc.short_description}} 4 | 5 | {{#phpdoc.long_description}} 6 | 7 | *** 8 | 9 | ## Usage 10 | 11 | {{{phpdoc.long_description}}} 12 | 13 | {{/phpdoc.long_description}} 14 | 15 | *Behat steps documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please submit a pull request.* 16 | 17 | {{#has_related}} 18 | 19 | *** 20 | 21 | ## Related 22 | 23 | 36 | 37 | {{/has_related}} 38 | 39 | -------------------------------------------------------------------------------- /bin/templates/internal-api-list.mustache: -------------------------------------------------------------------------------- 1 | 10 | -------------------------------------------------------------------------------- /bin/templates/internal-api.mustache: -------------------------------------------------------------------------------- 1 | # {{full_name}}() 2 | 3 | {{phpdoc.short_description}} 4 | 5 | *** 6 | 7 | ## Usage 8 | 9 | {{signature}} 10 | 11 |
12 | {{#phpdoc.parameters.param}} 13 | {{1}} ({{0}}) {{{2}}}
14 | {{/phpdoc.parameters.param}} 15 | {{#phpdoc.parameters.return}} 16 | @return ({{0}}) {{2}}
17 | {{/phpdoc.parameters.return}} 18 |
19 | 20 | {{#phpdoc.long_description}} 21 | 22 | *** 23 | 24 | ## Notes 25 | 26 | {{{phpdoc.long_description}}} 27 | 28 | {{/phpdoc.long_description}} 29 | 30 | *Internal API documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please submit a pull request.* 31 | 32 | {{#has_related}} 33 | 34 | *** 35 | 36 | ## Related 37 | 38 | 51 | 52 | {{/has_related}} 53 | 54 | -------------------------------------------------------------------------------- /bin/templates/subcmd-list.mustache: -------------------------------------------------------------------------------- 1 | # wp {{synopsis}} 2 | 3 | {{description}} 4 | 5 | {{{docs}}} 6 | -------------------------------------------------------------------------------- /commands/admin.md: -------------------------------------------------------------------------------- 1 | # wp admin 2 | 3 | Open /wp-admin/ in a browser. 4 | 5 | 6 | 7 | ### GLOBAL PARAMETERS 8 | 9 | These [global parameters](https://make.wordpress.org/cli/handbook/config/) have the same behavior across all commands and affect how WP-CLI interacts with WordPress. 10 | 11 | | **Argument** | **Description** | 12 | |:----------------|:-----------------------------| 13 | | `--path=` | Path to the WordPress files. | 14 | | `--url=` | Pretend request came from given URL. In multisite, this argument is how the target site is specified. | 15 | | `--ssh=[:][@][:][]` | Perform operation against a remote server over SSH (or a container using scheme of "docker", "docker-compose", "docker-compose-run", "vagrant"). | 16 | | `--http=` | Perform operation against a remote WordPress installation over HTTP. | 17 | | `--user=` | Set the WordPress user. | 18 | | `--skip-plugins[=]` | Skip loading all plugins, or a comma-separated list of plugins. Note: mu-plugins are still loaded. | 19 | | `--skip-themes[=]` | Skip loading all themes, or a comma-separated list of themes. | 20 | | `--skip-packages` | Skip loading all installed packages. | 21 | | `--require=` | Load PHP file before running the command (may be used more than once). | 22 | | `--exec=` | Execute PHP code before running the command (may be used more than once). | 23 | | `--context=` | Load WordPress in a given context. | 24 | | `--[no-]color` | Whether to colorize the output. | 25 | | `--debug[=]` | Show all PHP errors and add verbosity to WP-CLI output. Built-in groups include: bootstrap, commandfactory, and help. | 26 | | `--prompt[=]` | Prompt the user to enter values for all command arguments, or a subset specified as comma-separated values. | 27 | | `--quiet` | Suppress informational messages. | 28 | -------------------------------------------------------------------------------- /commands/cache.md: -------------------------------------------------------------------------------- 1 | # wp cache 2 | 3 | Adds, removes, fetches, and flushes the WP Object Cache object. 4 | 5 | By default, the WP Object Cache exists in PHP memory for the length of the request (and is emptied at the end). Use a persistent object cache drop-in to persist the object cache between requests. 6 | 7 | [Read the codex article](https://codex.wordpress.org/Class_Reference/WP_Object_Cache) for more detail. 8 | 9 | ### EXAMPLES 10 | 11 | # Set cache. 12 | $ wp cache set my_key my_value my_group 300 13 | Success: Set object 'my_key' in group 'my_group'. 14 | 15 | # Get cache. 16 | $ wp cache get my_key my_group 17 | my_value 18 | 19 | 20 | -------------------------------------------------------------------------------- /commands/cache/flush-group.md: -------------------------------------------------------------------------------- 1 | # wp cache flush-group 2 | 3 | Removes all cache items in a group, if the object cache implementation supports it. 4 | 5 | ### OPTIONS 6 | 7 | <group> 8 | : Cache group key. 9 | 10 | ### EXAMPLES 11 | 12 | # Clear cache group. 13 | $ wp cache flush-group my_group 14 | Success: Cache group 'my_group' was flushed. 15 | 16 | ### GLOBAL PARAMETERS 17 | 18 | These [global parameters](https://make.wordpress.org/cli/handbook/config/) have the same behavior across all commands and affect how WP-CLI interacts with WordPress. 19 | 20 | | **Argument** | **Description** | 21 | |:----------------|:-----------------------------| 22 | | `--path=` | Path to the WordPress files. | 23 | | `--url=` | Pretend request came from given URL. In multisite, this argument is how the target site is specified. | 24 | | `--ssh=[:][@][:][]` | Perform operation against a remote server over SSH (or a container using scheme of "docker", "docker-compose", "docker-compose-run", "vagrant"). | 25 | | `--http=` | Perform operation against a remote WordPress installation over HTTP. | 26 | | `--user=` | Set the WordPress user. | 27 | | `--skip-plugins[=]` | Skip loading all plugins, or a comma-separated list of plugins. Note: mu-plugins are still loaded. | 28 | | `--skip-themes[=]` | Skip loading all themes, or a comma-separated list of themes. | 29 | | `--skip-packages` | Skip loading all installed packages. | 30 | | `--require=` | Load PHP file before running the command (may be used more than once). | 31 | | `--exec=` | Execute PHP code before running the command (may be used more than once). | 32 | | `--context=` | Load WordPress in a given context. | 33 | | `--[no-]color` | Whether to colorize the output. | 34 | | `--debug[=]` | Show all PHP errors and add verbosity to WP-CLI output. Built-in groups include: bootstrap, commandfactory, and help. | 35 | | `--prompt[=]` | Prompt the user to enter values for all command arguments, or a subset specified as comma-separated values. | 36 | | `--quiet` | Suppress informational messages. | 37 | -------------------------------------------------------------------------------- /commands/cap.md: -------------------------------------------------------------------------------- 1 | # wp cap 2 | 3 | Adds, removes, and lists capabilities of a user role. 4 | 5 | See references for [Roles and Capabilities](https://codex.wordpress.org/Roles_and_Capabilities) and [WP User class](https://codex.wordpress.org/Class_Reference/WP_User). 6 | 7 | ### EXAMPLES 8 | 9 | # Add 'spectate' capability to 'author' role. 10 | $ wp cap add 'author' 'spectate' 11 | Success: Added 1 capability to 'author' role. 12 | 13 | # Add all caps from 'editor' role to 'author' role. 14 | $ wp cap list 'editor' | xargs wp cap add 'author' 15 | Success: Added 24 capabilities to 'author' role. 16 | 17 | # Remove all caps from 'editor' role that also appear in 'author' role. 18 | $ wp cap list 'author' | xargs wp cap remove 'editor' 19 | Success: Removed 34 capabilities from 'editor' role. 20 | 21 | 22 | -------------------------------------------------------------------------------- /commands/cap/remove.md: -------------------------------------------------------------------------------- 1 | # wp cap remove 2 | 3 | Removes capabilities from a given role. 4 | 5 | ### OPTIONS 6 | 7 | <role> 8 | : Key for the role. 9 | 10 | <cap>... 11 | : One or more capabilities to remove. 12 | 13 | ### EXAMPLES 14 | 15 | # Remove 'spectate' capability from 'author' role. 16 | $ wp cap remove author spectate 17 | Success: Removed 1 capability from 'author' role. 18 | 19 | ### GLOBAL PARAMETERS 20 | 21 | These [global parameters](https://make.wordpress.org/cli/handbook/config/) have the same behavior across all commands and affect how WP-CLI interacts with WordPress. 22 | 23 | | **Argument** | **Description** | 24 | |:----------------|:-----------------------------| 25 | | `--path=` | Path to the WordPress files. | 26 | | `--url=` | Pretend request came from given URL. In multisite, this argument is how the target site is specified. | 27 | | `--ssh=[:][@][:][]` | Perform operation against a remote server over SSH (or a container using scheme of "docker", "docker-compose", "docker-compose-run", "vagrant"). | 28 | | `--http=` | Perform operation against a remote WordPress installation over HTTP. | 29 | | `--user=` | Set the WordPress user. | 30 | | `--skip-plugins[=]` | Skip loading all plugins, or a comma-separated list of plugins. Note: mu-plugins are still loaded. | 31 | | `--skip-themes[=]` | Skip loading all themes, or a comma-separated list of themes. | 32 | | `--skip-packages` | Skip loading all installed packages. | 33 | | `--require=` | Load PHP file before running the command (may be used more than once). | 34 | | `--exec=` | Execute PHP code before running the command (may be used more than once). | 35 | | `--context=` | Load WordPress in a given context. | 36 | | `--[no-]color` | Whether to colorize the output. | 37 | | `--debug[=]` | Show all PHP errors and add verbosity to WP-CLI output. Built-in groups include: bootstrap, commandfactory, and help. | 38 | | `--prompt[=]` | Prompt the user to enter values for all command arguments, or a subset specified as comma-separated values. | 39 | | `--quiet` | Suppress informational messages. | 40 | -------------------------------------------------------------------------------- /commands/cli.md: -------------------------------------------------------------------------------- 1 | # wp cli 2 | 3 | Reviews current WP-CLI info, checks for updates, or views defined aliases. 4 | 5 | Unless overridden, these commands run on the `before_wp_load` hook, just before the WP load process begins. 6 | 7 | ### EXAMPLES 8 | 9 | # Display the version currently installed. 10 | $ wp cli version 11 | WP-CLI 0.24.1 12 | 13 | # Check for updates to WP-CLI. 14 | $ wp cli check-update 15 | Success: WP-CLI is at the latest version. 16 | 17 | # Update WP-CLI to the latest stable release. 18 | $ wp cli update 19 | You have version 0.24.0. Would you like to update to 0.24.1? [y/n] y 20 | Downloading from https://github.com/wp-cli/wp-cli/releases/download/v0.24.1/wp-cli-0.24.1.phar... 21 | New version works. Proceeding to replace. 22 | Success: Updated WP-CLI to 0.24.1. 23 | 24 | # Clear the internal WP-CLI cache. 25 | $ wp cli cache clear 26 | Success: Cache cleared. 27 | 28 | 29 | -------------------------------------------------------------------------------- /commands/cli/alias.md: -------------------------------------------------------------------------------- 1 | # wp cli alias 2 | 3 | Retrieves, sets and updates aliases for WordPress Installations. 4 | 5 | Unless overridden, these commands run on the `before_wp_load` hook, just before the WP load process begins. 6 | 7 | Aliases are shorthand references to WordPress installs. For instance, `@dev` could refer to a development install and `@prod` could refer to a production install. This command gives you and option to add, update and delete, the registered aliases you have available. 8 | 9 | ### EXAMPLES 10 | 11 | # List alias information. 12 | $ wp cli alias list 13 | list 14 | --- 15 | @all: Run command against every registered alias. 16 | @local: 17 | user: wpcli 18 | path: /Users/wpcli/sites/testsite 19 | 20 | # Get alias information. 21 | $ wp cli alias get @dev 22 | ssh: dev@somedeve.env:12345/home/dev/ 23 | 24 | # Add alias. 25 | $ wp cli alias add @prod --set-ssh=login@host --set-path=/path/to/wordpress/install/ --set-user=wpcli 26 | Success: Added '@prod' alias. 27 | 28 | # Update alias. 29 | $ wp cli alias update @prod --set-user=newuser --set-path=/new/path/to/wordpress/install/ 30 | Success: Updated 'prod' alias. 31 | 32 | # Delete alias. 33 | $ wp cli alias delete @prod 34 | Success: Deleted '@prod' alias. 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /commands/cli/alias/get.md: -------------------------------------------------------------------------------- 1 | # wp cli alias get 2 | 3 | Gets the value for an alias. 4 | 5 | This command runs on the `before_wp_load` hook, just before the WP load process begins. 6 | 7 | ### OPTIONS 8 | 9 | <key> 10 | : Key for the alias. 11 | 12 | ### EXAMPLES 13 | 14 | # Get alias. 15 | $ wp cli alias get @prod 16 | ssh: dev@somedeve.env:12345/home/dev/ 17 | 18 | ### GLOBAL PARAMETERS 19 | 20 | These [global parameters](https://make.wordpress.org/cli/handbook/config/) have the same behavior across all commands and affect how WP-CLI interacts with WordPress. 21 | 22 | | **Argument** | **Description** | 23 | |:----------------|:-----------------------------| 24 | | `--path=` | Path to the WordPress files. | 25 | | `--url=` | Pretend request came from given URL. In multisite, this argument is how the target site is specified. | 26 | | `--ssh=[:][@][:][]` | Perform operation against a remote server over SSH (or a container using scheme of "docker", "docker-compose", "docker-compose-run", "vagrant"). | 27 | | `--http=` | Perform operation against a remote WordPress installation over HTTP. | 28 | | `--user=` | Set the WordPress user. | 29 | | `--skip-plugins[=]` | Skip loading all plugins, or a comma-separated list of plugins. Note: mu-plugins are still loaded. | 30 | | `--skip-themes[=]` | Skip loading all themes, or a comma-separated list of themes. | 31 | | `--skip-packages` | Skip loading all installed packages. | 32 | | `--require=` | Load PHP file before running the command (may be used more than once). | 33 | | `--exec=` | Execute PHP code before running the command (may be used more than once). | 34 | | `--context=` | Load WordPress in a given context. | 35 | | `--[no-]color` | Whether to colorize the output. | 36 | | `--debug[=]` | Show all PHP errors and add verbosity to WP-CLI output. Built-in groups include: bootstrap, commandfactory, and help. | 37 | | `--prompt[=]` | Prompt the user to enter values for all command arguments, or a subset specified as comma-separated values. | 38 | | `--quiet` | Suppress informational messages. | 39 | -------------------------------------------------------------------------------- /commands/cli/cache.md: -------------------------------------------------------------------------------- 1 | # wp cli cache 2 | 3 | Manages the internal WP-CLI cache,. 4 | 5 | Unless overridden, these commands run on the `before_wp_load` hook, just before the WP load process begins. 6 | 7 | ### EXAMPLES 8 | 9 | # Remove all cached files. 10 | $ wp cli cache clear 11 | Success: Cache cleared. 12 | 13 | # Remove all cached files except for the newest version of each one. 14 | $ wp cli cache prune 15 | Success: Cache pruned. 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /commands/cli/cache/clear.md: -------------------------------------------------------------------------------- 1 | # wp cli cache clear 2 | 3 | Clears the internal cache. 4 | 5 | This command runs on the `before_wp_load` hook, just before the WP load process begins. 6 | 7 | ### EXAMPLES 8 | 9 | $ wp cli cache clear 10 | Success: Cache cleared. 11 | 12 | ### GLOBAL PARAMETERS 13 | 14 | These [global parameters](https://make.wordpress.org/cli/handbook/config/) have the same behavior across all commands and affect how WP-CLI interacts with WordPress. 15 | 16 | | **Argument** | **Description** | 17 | |:----------------|:-----------------------------| 18 | | `--path=` | Path to the WordPress files. | 19 | | `--url=` | Pretend request came from given URL. In multisite, this argument is how the target site is specified. | 20 | | `--ssh=[:][@][:][]` | Perform operation against a remote server over SSH (or a container using scheme of "docker", "docker-compose", "docker-compose-run", "vagrant"). | 21 | | `--http=` | Perform operation against a remote WordPress installation over HTTP. | 22 | | `--user=` | Set the WordPress user. | 23 | | `--skip-plugins[=]` | Skip loading all plugins, or a comma-separated list of plugins. Note: mu-plugins are still loaded. | 24 | | `--skip-themes[=]` | Skip loading all themes, or a comma-separated list of themes. | 25 | | `--skip-packages` | Skip loading all installed packages. | 26 | | `--require=` | Load PHP file before running the command (may be used more than once). | 27 | | `--exec=` | Execute PHP code before running the command (may be used more than once). | 28 | | `--context=` | Load WordPress in a given context. | 29 | | `--[no-]color` | Whether to colorize the output. | 30 | | `--debug[=]` | Show all PHP errors and add verbosity to WP-CLI output. Built-in groups include: bootstrap, commandfactory, and help. | 31 | | `--prompt[=]` | Prompt the user to enter values for all command arguments, or a subset specified as comma-separated values. | 32 | | `--quiet` | Suppress informational messages. | 33 | -------------------------------------------------------------------------------- /commands/cli/cache/prune.md: -------------------------------------------------------------------------------- 1 | # wp cli cache prune 2 | 3 | Prunes the internal cache. 4 | 5 | This command runs on the `before_wp_load` hook, just before the WP load process begins. 6 | 7 | Removes all cached files except for the newest version of each one. 8 | 9 | ### EXAMPLES 10 | 11 | $ wp cli cache prune 12 | Success: Cache pruned. 13 | 14 | ### GLOBAL PARAMETERS 15 | 16 | These [global parameters](https://make.wordpress.org/cli/handbook/config/) have the same behavior across all commands and affect how WP-CLI interacts with WordPress. 17 | 18 | | **Argument** | **Description** | 19 | |:----------------|:-----------------------------| 20 | | `--path=` | Path to the WordPress files. | 21 | | `--url=` | Pretend request came from given URL. In multisite, this argument is how the target site is specified. | 22 | | `--ssh=[:][@][:][]` | Perform operation against a remote server over SSH (or a container using scheme of "docker", "docker-compose", "docker-compose-run", "vagrant"). | 23 | | `--http=` | Perform operation against a remote WordPress installation over HTTP. | 24 | | `--user=` | Set the WordPress user. | 25 | | `--skip-plugins[=]` | Skip loading all plugins, or a comma-separated list of plugins. Note: mu-plugins are still loaded. | 26 | | `--skip-themes[=]` | Skip loading all themes, or a comma-separated list of themes. | 27 | | `--skip-packages` | Skip loading all installed packages. | 28 | | `--require=` | Load PHP file before running the command (may be used more than once). | 29 | | `--exec=` | Execute PHP code before running the command (may be used more than once). | 30 | | `--context=` | Load WordPress in a given context. | 31 | | `--[no-]color` | Whether to colorize the output. | 32 | | `--debug[=]` | Show all PHP errors and add verbosity to WP-CLI output. Built-in groups include: bootstrap, commandfactory, and help. | 33 | | `--prompt[=]` | Prompt the user to enter values for all command arguments, or a subset specified as comma-separated values. | 34 | | `--quiet` | Suppress informational messages. | 35 | -------------------------------------------------------------------------------- /commands/cli/cmd-dump.md: -------------------------------------------------------------------------------- 1 | # wp cli cmd-dump 2 | 3 | Dumps the list of installed commands, as JSON. 4 | 5 | This command runs on the `before_wp_load` hook, just before the WP load process begins. 6 | 7 | ### EXAMPLES 8 | 9 | # Dump the list of installed commands. 10 | $ wp cli cmd-dump 11 | {"name":"wp","description":"Manage WordPress through the command-line.","longdesc":"\n\n## GLOBAL PARAMETERS 12 | 13 | These [global parameters](https://make.wordpress.org/cli/handbook/config/) have the same behavior across all commands and affect how WP-CLI interacts with WordPress. 14 | 15 | | **Argument** | **Description** | 16 | |:----------------|:-----------------------------| 17 | | `--path=` | Path to the WordPress files. | 18 | | `--url=` | Pretend request came from given URL. In multisite, this argument is how the target site is specified. | 19 | | `--ssh=[:][@][:][]` | Perform operation against a remote server over SSH (or a container using scheme of "docker", "docker-compose", "docker-compose-run", "vagrant"). | 20 | | `--http=` | Perform operation against a remote WordPress installation over HTTP. | 21 | | `--user=` | Set the WordPress user. | 22 | | `--skip-plugins[=]` | Skip loading all plugins, or a comma-separated list of plugins. Note: mu-plugins are still loaded. | 23 | | `--skip-themes[=]` | Skip loading all themes, or a comma-separated list of themes. | 24 | | `--skip-packages` | Skip loading all installed packages. | 25 | | `--require=` | Load PHP file before running the command (may be used more than once). | 26 | | `--exec=` | Execute PHP code before running the command (may be used more than once). | 27 | | `--context=` | Load WordPress in a given context. | 28 | | `--[no-]color` | Whether to colorize the output. | 29 | | `--debug[=]` | Show all PHP errors and add verbosity to WP-CLI output. Built-in groups include: bootstrap, commandfactory, and help. | 30 | | `--prompt[=]` | Prompt the user to enter values for all command arguments, or a subset specified as comma-separated values. | 31 | | `--quiet` | Suppress informational messages. | 32 | -------------------------------------------------------------------------------- /commands/cli/version.md: -------------------------------------------------------------------------------- 1 | # wp cli version 2 | 3 | Prints WP-CLI version. 4 | 5 | This command runs on the `before_wp_load` hook, just before the WP load process begins. 6 | 7 | ### EXAMPLES 8 | 9 | # Display CLI version. 10 | $ wp cli version 11 | WP-CLI 0.24.1 12 | 13 | ### GLOBAL PARAMETERS 14 | 15 | These [global parameters](https://make.wordpress.org/cli/handbook/config/) have the same behavior across all commands and affect how WP-CLI interacts with WordPress. 16 | 17 | | **Argument** | **Description** | 18 | |:----------------|:-----------------------------| 19 | | `--path=` | Path to the WordPress files. | 20 | | `--url=` | Pretend request came from given URL. In multisite, this argument is how the target site is specified. | 21 | | `--ssh=[:][@][:][]` | Perform operation against a remote server over SSH (or a container using scheme of "docker", "docker-compose", "docker-compose-run", "vagrant"). | 22 | | `--http=` | Perform operation against a remote WordPress installation over HTTP. | 23 | | `--user=` | Set the WordPress user. | 24 | | `--skip-plugins[=]` | Skip loading all plugins, or a comma-separated list of plugins. Note: mu-plugins are still loaded. | 25 | | `--skip-themes[=]` | Skip loading all themes, or a comma-separated list of themes. | 26 | | `--skip-packages` | Skip loading all installed packages. | 27 | | `--require=` | Load PHP file before running the command (may be used more than once). | 28 | | `--exec=` | Execute PHP code before running the command (may be used more than once). | 29 | | `--context=` | Load WordPress in a given context. | 30 | | `--[no-]color` | Whether to colorize the output. | 31 | | `--debug[=]` | Show all PHP errors and add verbosity to WP-CLI output. Built-in groups include: bootstrap, commandfactory, and help. | 32 | | `--prompt[=]` | Prompt the user to enter values for all command arguments, or a subset specified as comma-separated values. | 33 | | `--quiet` | Suppress informational messages. | 34 | -------------------------------------------------------------------------------- /commands/comment.md: -------------------------------------------------------------------------------- 1 | # wp comment 2 | 3 | Creates, updates, deletes, and moderates comments. 4 | 5 | ### EXAMPLES 6 | 7 | # Create a new comment. 8 | $ wp comment create --comment_post_ID=15 --comment_content="hello blog" --comment_author="wp-cli" 9 | Success: Created comment 932. 10 | 11 | # Update an existing comment. 12 | $ wp comment update 123 --comment_author='That Guy' 13 | Success: Updated comment 123. 14 | 15 | # Delete an existing comment. 16 | $ wp comment delete 1337 --force 17 | Success: Deleted comment 1337. 18 | 19 | # Trash all spam comments. 20 | $ wp comment delete $(wp comment list --status=spam --format=ids) 21 | Success: Trashed comment 264. 22 | Success: Trashed comment 262. 23 | 24 | 25 | -------------------------------------------------------------------------------- /commands/comment/approve.md: -------------------------------------------------------------------------------- 1 | # wp comment approve 2 | 3 | Approves a comment. 4 | 5 | ### OPTIONS 6 | 7 | <id>... 8 | : The IDs of the comments to approve. 9 | 10 | ### EXAMPLES 11 | 12 | # Approve comment. 13 | $ wp comment approve 1337 14 | Success: Approved comment 1337. 15 | 16 | ### GLOBAL PARAMETERS 17 | 18 | These [global parameters](https://make.wordpress.org/cli/handbook/config/) have the same behavior across all commands and affect how WP-CLI interacts with WordPress. 19 | 20 | | **Argument** | **Description** | 21 | |:----------------|:-----------------------------| 22 | | `--path=` | Path to the WordPress files. | 23 | | `--url=` | Pretend request came from given URL. In multisite, this argument is how the target site is specified. | 24 | | `--ssh=[:][@][:][]` | Perform operation against a remote server over SSH (or a container using scheme of "docker", "docker-compose", "docker-compose-run", "vagrant"). | 25 | | `--http=` | Perform operation against a remote WordPress installation over HTTP. | 26 | | `--user=` | Set the WordPress user. | 27 | | `--skip-plugins[=]` | Skip loading all plugins, or a comma-separated list of plugins. Note: mu-plugins are still loaded. | 28 | | `--skip-themes[=]` | Skip loading all themes, or a comma-separated list of themes. | 29 | | `--skip-packages` | Skip loading all installed packages. | 30 | | `--require=` | Load PHP file before running the command (may be used more than once). | 31 | | `--exec=` | Execute PHP code before running the command (may be used more than once). | 32 | | `--context=` | Load WordPress in a given context. | 33 | | `--[no-]color` | Whether to colorize the output. | 34 | | `--debug[=]` | Show all PHP errors and add verbosity to WP-CLI output. Built-in groups include: bootstrap, commandfactory, and help. | 35 | | `--prompt[=]` | Prompt the user to enter values for all command arguments, or a subset specified as comma-separated values. | 36 | | `--quiet` | Suppress informational messages. | 37 | -------------------------------------------------------------------------------- /commands/comment/exists.md: -------------------------------------------------------------------------------- 1 | # wp comment exists 2 | 3 | Verifies whether a comment exists. 4 | 5 | Displays a success message if the comment does exist. 6 | 7 | ### OPTIONS 8 | 9 | <id> 10 | : The ID of the comment to check. 11 | 12 | ### EXAMPLES 13 | 14 | # Check whether comment exists. 15 | $ wp comment exists 1337 16 | Success: Comment with ID 1337 exists. 17 | 18 | ### GLOBAL PARAMETERS 19 | 20 | These [global parameters](https://make.wordpress.org/cli/handbook/config/) have the same behavior across all commands and affect how WP-CLI interacts with WordPress. 21 | 22 | | **Argument** | **Description** | 23 | |:----------------|:-----------------------------| 24 | | `--path=` | Path to the WordPress files. | 25 | | `--url=` | Pretend request came from given URL. In multisite, this argument is how the target site is specified. | 26 | | `--ssh=[:][@][:][]` | Perform operation against a remote server over SSH (or a container using scheme of "docker", "docker-compose", "docker-compose-run", "vagrant"). | 27 | | `--http=` | Perform operation against a remote WordPress installation over HTTP. | 28 | | `--user=` | Set the WordPress user. | 29 | | `--skip-plugins[=]` | Skip loading all plugins, or a comma-separated list of plugins. Note: mu-plugins are still loaded. | 30 | | `--skip-themes[=]` | Skip loading all themes, or a comma-separated list of themes. | 31 | | `--skip-packages` | Skip loading all installed packages. | 32 | | `--require=` | Load PHP file before running the command (may be used more than once). | 33 | | `--exec=` | Execute PHP code before running the command (may be used more than once). | 34 | | `--context=` | Load WordPress in a given context. | 35 | | `--[no-]color` | Whether to colorize the output. | 36 | | `--debug[=]` | Show all PHP errors and add verbosity to WP-CLI output. Built-in groups include: bootstrap, commandfactory, and help. | 37 | | `--prompt[=]` | Prompt the user to enter values for all command arguments, or a subset specified as comma-separated values. | 38 | | `--quiet` | Suppress informational messages. | 39 | -------------------------------------------------------------------------------- /commands/comment/meta.md: -------------------------------------------------------------------------------- 1 | # wp comment meta 2 | 3 | Adds, updates, deletes, and lists comment custom fields. 4 | 5 | ### EXAMPLES 6 | 7 | # Set comment meta 8 | $ wp comment meta set 123 description "Mary is a WordPress developer." 9 | Success: Updated custom field 'description'. 10 | 11 | # Get comment meta 12 | $ wp comment meta get 123 description 13 | Mary is a WordPress developer. 14 | 15 | # Update comment meta 16 | $ wp comment meta update 123 description "Mary is an awesome WordPress developer." 17 | Success: Updated custom field 'description'. 18 | 19 | # Delete comment meta 20 | $ wp comment meta delete 123 description 21 | Success: Deleted custom field. 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /commands/comment/meta/delete.md: -------------------------------------------------------------------------------- 1 | # wp comment meta delete 2 | 3 | Delete a meta field. 4 | 5 | ### OPTIONS 6 | 7 | <id> 8 | : The ID of the object. 9 | 10 | [<key>] 11 | : The name of the meta field to delete. 12 | 13 | [<value>] 14 | : The value to delete. If omitted, all rows with key will deleted. 15 | 16 | [\--all] 17 | : Delete all meta for the object. 18 | 19 | ### GLOBAL PARAMETERS 20 | 21 | These [global parameters](https://make.wordpress.org/cli/handbook/config/) have the same behavior across all commands and affect how WP-CLI interacts with WordPress. 22 | 23 | | **Argument** | **Description** | 24 | |:----------------|:-----------------------------| 25 | | `--path=` | Path to the WordPress files. | 26 | | `--url=` | Pretend request came from given URL. In multisite, this argument is how the target site is specified. | 27 | | `--ssh=[:][@][:][]` | Perform operation against a remote server over SSH (or a container using scheme of "docker", "docker-compose", "docker-compose-run", "vagrant"). | 28 | | `--http=` | Perform operation against a remote WordPress installation over HTTP. | 29 | | `--user=` | Set the WordPress user. | 30 | | `--skip-plugins[=]` | Skip loading all plugins, or a comma-separated list of plugins. Note: mu-plugins are still loaded. | 31 | | `--skip-themes[=]` | Skip loading all themes, or a comma-separated list of themes. | 32 | | `--skip-packages` | Skip loading all installed packages. | 33 | | `--require=` | Load PHP file before running the command (may be used more than once). | 34 | | `--exec=` | Execute PHP code before running the command (may be used more than once). | 35 | | `--context=` | Load WordPress in a given context. | 36 | | `--[no-]color` | Whether to colorize the output. | 37 | | `--debug[=]` | Show all PHP errors and add verbosity to WP-CLI output. Built-in groups include: bootstrap, commandfactory, and help. | 38 | | `--prompt[=]` | Prompt the user to enter values for all command arguments, or a subset specified as comma-separated values. | 39 | | `--quiet` | Suppress informational messages. | 40 | -------------------------------------------------------------------------------- /commands/comment/recount.md: -------------------------------------------------------------------------------- 1 | # wp comment recount 2 | 3 | Recalculates the comment_count value for one or more posts. 4 | 5 | ### OPTIONS 6 | 7 | <id>... 8 | : IDs for one or more posts to update. 9 | 10 | ### EXAMPLES 11 | 12 | # Recount comment for the post. 13 | $ wp comment recount 123 14 | Updated post 123 comment count to 67. 15 | 16 | ### GLOBAL PARAMETERS 17 | 18 | These [global parameters](https://make.wordpress.org/cli/handbook/config/) have the same behavior across all commands and affect how WP-CLI interacts with WordPress. 19 | 20 | | **Argument** | **Description** | 21 | |:----------------|:-----------------------------| 22 | | `--path=` | Path to the WordPress files. | 23 | | `--url=` | Pretend request came from given URL. In multisite, this argument is how the target site is specified. | 24 | | `--ssh=[:][@][:][]` | Perform operation against a remote server over SSH (or a container using scheme of "docker", "docker-compose", "docker-compose-run", "vagrant"). | 25 | | `--http=` | Perform operation against a remote WordPress installation over HTTP. | 26 | | `--user=` | Set the WordPress user. | 27 | | `--skip-plugins[=]` | Skip loading all plugins, or a comma-separated list of plugins. Note: mu-plugins are still loaded. | 28 | | `--skip-themes[=]` | Skip loading all themes, or a comma-separated list of themes. | 29 | | `--skip-packages` | Skip loading all installed packages. | 30 | | `--require=` | Load PHP file before running the command (may be used more than once). | 31 | | `--exec=` | Execute PHP code before running the command (may be used more than once). | 32 | | `--context=` | Load WordPress in a given context. | 33 | | `--[no-]color` | Whether to colorize the output. | 34 | | `--debug[=]` | Show all PHP errors and add verbosity to WP-CLI output. Built-in groups include: bootstrap, commandfactory, and help. | 35 | | `--prompt[=]` | Prompt the user to enter values for all command arguments, or a subset specified as comma-separated values. | 36 | | `--quiet` | Suppress informational messages. | 37 | -------------------------------------------------------------------------------- /commands/comment/spam.md: -------------------------------------------------------------------------------- 1 | # wp comment spam 2 | 3 | Marks a comment as spam. 4 | 5 | ### OPTIONS 6 | 7 | <id>... 8 | : The IDs of the comments to mark as spam. 9 | 10 | ### EXAMPLES 11 | 12 | # Spam comment. 13 | $ wp comment spam 1337 14 | Success: Marked as spam comment 1337. 15 | 16 | ### GLOBAL PARAMETERS 17 | 18 | These [global parameters](https://make.wordpress.org/cli/handbook/config/) have the same behavior across all commands and affect how WP-CLI interacts with WordPress. 19 | 20 | | **Argument** | **Description** | 21 | |:----------------|:-----------------------------| 22 | | `--path=` | Path to the WordPress files. | 23 | | `--url=` | Pretend request came from given URL. In multisite, this argument is how the target site is specified. | 24 | | `--ssh=[:][@][:][]` | Perform operation against a remote server over SSH (or a container using scheme of "docker", "docker-compose", "docker-compose-run", "vagrant"). | 25 | | `--http=` | Perform operation against a remote WordPress installation over HTTP. | 26 | | `--user=` | Set the WordPress user. | 27 | | `--skip-plugins[=]` | Skip loading all plugins, or a comma-separated list of plugins. Note: mu-plugins are still loaded. | 28 | | `--skip-themes[=]` | Skip loading all themes, or a comma-separated list of themes. | 29 | | `--skip-packages` | Skip loading all installed packages. | 30 | | `--require=` | Load PHP file before running the command (may be used more than once). | 31 | | `--exec=` | Execute PHP code before running the command (may be used more than once). | 32 | | `--context=` | Load WordPress in a given context. | 33 | | `--[no-]color` | Whether to colorize the output. | 34 | | `--debug[=]` | Show all PHP errors and add verbosity to WP-CLI output. Built-in groups include: bootstrap, commandfactory, and help. | 35 | | `--prompt[=]` | Prompt the user to enter values for all command arguments, or a subset specified as comma-separated values. | 36 | | `--quiet` | Suppress informational messages. | 37 | -------------------------------------------------------------------------------- /commands/comment/status.md: -------------------------------------------------------------------------------- 1 | # wp comment status 2 | 3 | Gets the status of a comment. 4 | 5 | ### OPTIONS 6 | 7 | <id> 8 | : The ID of the comment to check. 9 | 10 | ### EXAMPLES 11 | 12 | # Get status of comment. 13 | $ wp comment status 1337 14 | approved 15 | 16 | ### GLOBAL PARAMETERS 17 | 18 | These [global parameters](https://make.wordpress.org/cli/handbook/config/) have the same behavior across all commands and affect how WP-CLI interacts with WordPress. 19 | 20 | | **Argument** | **Description** | 21 | |:----------------|:-----------------------------| 22 | | `--path=` | Path to the WordPress files. | 23 | | `--url=` | Pretend request came from given URL. In multisite, this argument is how the target site is specified. | 24 | | `--ssh=[:][@][:][]` | Perform operation against a remote server over SSH (or a container using scheme of "docker", "docker-compose", "docker-compose-run", "vagrant"). | 25 | | `--http=` | Perform operation against a remote WordPress installation over HTTP. | 26 | | `--user=` | Set the WordPress user. | 27 | | `--skip-plugins[=]` | Skip loading all plugins, or a comma-separated list of plugins. Note: mu-plugins are still loaded. | 28 | | `--skip-themes[=]` | Skip loading all themes, or a comma-separated list of themes. | 29 | | `--skip-packages` | Skip loading all installed packages. | 30 | | `--require=` | Load PHP file before running the command (may be used more than once). | 31 | | `--exec=` | Execute PHP code before running the command (may be used more than once). | 32 | | `--context=` | Load WordPress in a given context. | 33 | | `--[no-]color` | Whether to colorize the output. | 34 | | `--debug[=]` | Show all PHP errors and add verbosity to WP-CLI output. Built-in groups include: bootstrap, commandfactory, and help. | 35 | | `--prompt[=]` | Prompt the user to enter values for all command arguments, or a subset specified as comma-separated values. | 36 | | `--quiet` | Suppress informational messages. | 37 | -------------------------------------------------------------------------------- /commands/comment/trash.md: -------------------------------------------------------------------------------- 1 | # wp comment trash 2 | 3 | Trashes a comment. 4 | 5 | ### OPTIONS 6 | 7 | <id>... 8 | : The IDs of the comments to trash. 9 | 10 | ### EXAMPLES 11 | 12 | # Trash comment. 13 | $ wp comment trash 1337 14 | Success: Trashed comment 1337. 15 | 16 | ### GLOBAL PARAMETERS 17 | 18 | These [global parameters](https://make.wordpress.org/cli/handbook/config/) have the same behavior across all commands and affect how WP-CLI interacts with WordPress. 19 | 20 | | **Argument** | **Description** | 21 | |:----------------|:-----------------------------| 22 | | `--path=` | Path to the WordPress files. | 23 | | `--url=` | Pretend request came from given URL. In multisite, this argument is how the target site is specified. | 24 | | `--ssh=[:][@][:][]` | Perform operation against a remote server over SSH (or a container using scheme of "docker", "docker-compose", "docker-compose-run", "vagrant"). | 25 | | `--http=` | Perform operation against a remote WordPress installation over HTTP. | 26 | | `--user=` | Set the WordPress user. | 27 | | `--skip-plugins[=]` | Skip loading all plugins, or a comma-separated list of plugins. Note: mu-plugins are still loaded. | 28 | | `--skip-themes[=]` | Skip loading all themes, or a comma-separated list of themes. | 29 | | `--skip-packages` | Skip loading all installed packages. | 30 | | `--require=` | Load PHP file before running the command (may be used more than once). | 31 | | `--exec=` | Execute PHP code before running the command (may be used more than once). | 32 | | `--context=` | Load WordPress in a given context. | 33 | | `--[no-]color` | Whether to colorize the output. | 34 | | `--debug[=]` | Show all PHP errors and add verbosity to WP-CLI output. Built-in groups include: bootstrap, commandfactory, and help. | 35 | | `--prompt[=]` | Prompt the user to enter values for all command arguments, or a subset specified as comma-separated values. | 36 | | `--quiet` | Suppress informational messages. | 37 | -------------------------------------------------------------------------------- /commands/comment/unapprove.md: -------------------------------------------------------------------------------- 1 | # wp comment unapprove 2 | 3 | Unapproves a comment. 4 | 5 | ### OPTIONS 6 | 7 | <id>... 8 | : The IDs of the comments to unapprove. 9 | 10 | ### EXAMPLES 11 | 12 | # Unapprove comment. 13 | $ wp comment unapprove 1337 14 | Success: Unapproved comment 1337. 15 | 16 | ### GLOBAL PARAMETERS 17 | 18 | These [global parameters](https://make.wordpress.org/cli/handbook/config/) have the same behavior across all commands and affect how WP-CLI interacts with WordPress. 19 | 20 | | **Argument** | **Description** | 21 | |:----------------|:-----------------------------| 22 | | `--path=` | Path to the WordPress files. | 23 | | `--url=` | Pretend request came from given URL. In multisite, this argument is how the target site is specified. | 24 | | `--ssh=[:][@][:][]` | Perform operation against a remote server over SSH (or a container using scheme of "docker", "docker-compose", "docker-compose-run", "vagrant"). | 25 | | `--http=` | Perform operation against a remote WordPress installation over HTTP. | 26 | | `--user=` | Set the WordPress user. | 27 | | `--skip-plugins[=]` | Skip loading all plugins, or a comma-separated list of plugins. Note: mu-plugins are still loaded. | 28 | | `--skip-themes[=]` | Skip loading all themes, or a comma-separated list of themes. | 29 | | `--skip-packages` | Skip loading all installed packages. | 30 | | `--require=` | Load PHP file before running the command (may be used more than once). | 31 | | `--exec=` | Execute PHP code before running the command (may be used more than once). | 32 | | `--context=` | Load WordPress in a given context. | 33 | | `--[no-]color` | Whether to colorize the output. | 34 | | `--debug[=]` | Show all PHP errors and add verbosity to WP-CLI output. Built-in groups include: bootstrap, commandfactory, and help. | 35 | | `--prompt[=]` | Prompt the user to enter values for all command arguments, or a subset specified as comma-separated values. | 36 | | `--quiet` | Suppress informational messages. | 37 | -------------------------------------------------------------------------------- /commands/comment/unspam.md: -------------------------------------------------------------------------------- 1 | # wp comment unspam 2 | 3 | Unmarks a comment as spam. 4 | 5 | ### OPTIONS 6 | 7 | <id>... 8 | : The IDs of the comments to unmark as spam. 9 | 10 | ### EXAMPLES 11 | 12 | # Unspam comment. 13 | $ wp comment unspam 1337 14 | Success: Unspammed comment 1337. 15 | 16 | ### GLOBAL PARAMETERS 17 | 18 | These [global parameters](https://make.wordpress.org/cli/handbook/config/) have the same behavior across all commands and affect how WP-CLI interacts with WordPress. 19 | 20 | | **Argument** | **Description** | 21 | |:----------------|:-----------------------------| 22 | | `--path=` | Path to the WordPress files. | 23 | | `--url=` | Pretend request came from given URL. In multisite, this argument is how the target site is specified. | 24 | | `--ssh=[:][@][:][]` | Perform operation against a remote server over SSH (or a container using scheme of "docker", "docker-compose", "docker-compose-run", "vagrant"). | 25 | | `--http=` | Perform operation against a remote WordPress installation over HTTP. | 26 | | `--user=` | Set the WordPress user. | 27 | | `--skip-plugins[=]` | Skip loading all plugins, or a comma-separated list of plugins. Note: mu-plugins are still loaded. | 28 | | `--skip-themes[=]` | Skip loading all themes, or a comma-separated list of themes. | 29 | | `--skip-packages` | Skip loading all installed packages. | 30 | | `--require=` | Load PHP file before running the command (may be used more than once). | 31 | | `--exec=` | Execute PHP code before running the command (may be used more than once). | 32 | | `--context=` | Load WordPress in a given context. | 33 | | `--[no-]color` | Whether to colorize the output. | 34 | | `--debug[=]` | Show all PHP errors and add verbosity to WP-CLI output. Built-in groups include: bootstrap, commandfactory, and help. | 35 | | `--prompt[=]` | Prompt the user to enter values for all command arguments, or a subset specified as comma-separated values. | 36 | | `--quiet` | Suppress informational messages. | 37 | -------------------------------------------------------------------------------- /commands/comment/untrash.md: -------------------------------------------------------------------------------- 1 | # wp comment untrash 2 | 3 | Untrashes a comment. 4 | 5 | ### OPTIONS 6 | 7 | <id>... 8 | : The IDs of the comments to untrash. 9 | 10 | ### EXAMPLES 11 | 12 | # Untrash comment. 13 | $ wp comment untrash 1337 14 | Success: Untrashed comment 1337. 15 | 16 | ### GLOBAL PARAMETERS 17 | 18 | These [global parameters](https://make.wordpress.org/cli/handbook/config/) have the same behavior across all commands and affect how WP-CLI interacts with WordPress. 19 | 20 | | **Argument** | **Description** | 21 | |:----------------|:-----------------------------| 22 | | `--path=` | Path to the WordPress files. | 23 | | `--url=` | Pretend request came from given URL. In multisite, this argument is how the target site is specified. | 24 | | `--ssh=[:][@][:][]` | Perform operation against a remote server over SSH (or a container using scheme of "docker", "docker-compose", "docker-compose-run", "vagrant"). | 25 | | `--http=` | Perform operation against a remote WordPress installation over HTTP. | 26 | | `--user=` | Set the WordPress user. | 27 | | `--skip-plugins[=]` | Skip loading all plugins, or a comma-separated list of plugins. Note: mu-plugins are still loaded. | 28 | | `--skip-themes[=]` | Skip loading all themes, or a comma-separated list of themes. | 29 | | `--skip-packages` | Skip loading all installed packages. | 30 | | `--require=` | Load PHP file before running the command (may be used more than once). | 31 | | `--exec=` | Execute PHP code before running the command (may be used more than once). | 32 | | `--context=` | Load WordPress in a given context. | 33 | | `--[no-]color` | Whether to colorize the output. | 34 | | `--debug[=]` | Show all PHP errors and add verbosity to WP-CLI output. Built-in groups include: bootstrap, commandfactory, and help. | 35 | | `--prompt[=]` | Prompt the user to enter values for all command arguments, or a subset specified as comma-separated values. | 36 | | `--quiet` | Suppress informational messages. | 37 | -------------------------------------------------------------------------------- /commands/config/path.md: -------------------------------------------------------------------------------- 1 | # wp config path 2 | 3 | Gets the path to wp-config.php file. 4 | 5 | This command runs on the `before_wp_load` hook, just before the WP load process begins. 6 | 7 | ### EXAMPLES 8 | 9 | # Get wp-config.php file path 10 | $ wp config path 11 | /home/person/htdocs/project/wp-config.php 12 | 13 | ### GLOBAL PARAMETERS 14 | 15 | These [global parameters](https://make.wordpress.org/cli/handbook/config/) have the same behavior across all commands and affect how WP-CLI interacts with WordPress. 16 | 17 | | **Argument** | **Description** | 18 | |:----------------|:-----------------------------| 19 | | `--path=` | Path to the WordPress files. | 20 | | `--url=` | Pretend request came from given URL. In multisite, this argument is how the target site is specified. | 21 | | `--ssh=[:][@][:][]` | Perform operation against a remote server over SSH (or a container using scheme of "docker", "docker-compose", "docker-compose-run", "vagrant"). | 22 | | `--http=` | Perform operation against a remote WordPress installation over HTTP. | 23 | | `--user=` | Set the WordPress user. | 24 | | `--skip-plugins[=]` | Skip loading all plugins, or a comma-separated list of plugins. Note: mu-plugins are still loaded. | 25 | | `--skip-themes[=]` | Skip loading all themes, or a comma-separated list of themes. | 26 | | `--skip-packages` | Skip loading all installed packages. | 27 | | `--require=` | Load PHP file before running the command (may be used more than once). | 28 | | `--exec=` | Execute PHP code before running the command (may be used more than once). | 29 | | `--context=` | Load WordPress in a given context. | 30 | | `--[no-]color` | Whether to colorize the output. | 31 | | `--debug[=]` | Show all PHP errors and add verbosity to WP-CLI output. Built-in groups include: bootstrap, commandfactory, and help. | 32 | | `--prompt[=]` | Prompt the user to enter values for all command arguments, or a subset specified as comma-separated values. | 33 | | `--quiet` | Suppress informational messages. | 34 | -------------------------------------------------------------------------------- /commands/core.md: -------------------------------------------------------------------------------- 1 | # wp core 2 | 3 | Downloads, installs, updates, and manages a WordPress installation. 4 | 5 | ### EXAMPLES 6 | 7 | # Download WordPress core 8 | $ wp core download --locale=nl_NL 9 | Downloading WordPress 4.5.2 (nl_NL)... 10 | md5 hash verified: c5366d05b521831dd0b29dfc386e56a5 11 | Success: WordPress downloaded. 12 | 13 | # Install WordPress 14 | $ wp core install --url=example.com --title=Example --admin_user=supervisor --admin_password=strongpassword --admin_email=info@example.com 15 | Success: WordPress installed successfully. 16 | 17 | # Display the WordPress version 18 | $ wp core version 19 | 4.5.2 20 | 21 | 22 | -------------------------------------------------------------------------------- /commands/cron.md: -------------------------------------------------------------------------------- 1 | # wp cron 2 | 3 | Tests, runs, and deletes WP-Cron events; manages WP-Cron schedules. 4 | 5 | ### EXAMPLES 6 | 7 | # Test WP Cron spawning system 8 | $ wp cron test 9 | Success: WP-Cron spawning is working as expected. 10 | 11 | 12 | -------------------------------------------------------------------------------- /commands/cron/event.md: -------------------------------------------------------------------------------- 1 | # wp cron event 2 | 3 | Schedules, runs, and deletes WP-Cron events. 4 | 5 | ### EXAMPLES 6 | 7 | # Schedule a new cron event 8 | $ wp cron event schedule cron_test 9 | Success: Scheduled event with hook 'cron_test' for 2016-05-31 10:19:16 GMT. 10 | 11 | # Run all cron events due right now 12 | $ wp cron event run --due-now 13 | Executed the cron event 'cron_test_1' in 0.01s. 14 | Executed the cron event 'cron_test_2' in 0.006s. 15 | Success: Executed a total of 2 cron events. 16 | 17 | # Delete all scheduled cron events for the given hook 18 | $ wp cron event delete cron_test 19 | Success: Deleted a total of 2 cron events. 20 | 21 | # List scheduled cron events in JSON 22 | $ wp cron event list --fields=hook,next_run --format=json 23 | [{"hook":"wp_version_check","next_run":"2016-05-31 10:15:13"},{"hook":"wp_update_plugins","next_run":"2016-05-31 10:15:13"},{"hook":"wp_update_themes","next_run":"2016-05-31 10:15:14"}] 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /commands/cron/schedule.md: -------------------------------------------------------------------------------- 1 | # wp cron schedule 2 | 3 | Gets WP-Cron schedules. 4 | 5 | ### EXAMPLES 6 | 7 | # List available cron schedules 8 | $ wp cron schedule list 9 | +------------+-------------+----------+ 10 | | name | display | interval | 11 | +------------+-------------+----------+ 12 | | hourly | Once Hourly | 3600 | 13 | | twicedaily | Twice Daily | 43200 | 14 | | daily | Once Daily | 86400 | 15 | +------------+-------------+----------+ 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /commands/db.md: -------------------------------------------------------------------------------- 1 | # wp db 2 | 3 | Performs basic database operations using credentials stored in wp-config.php. 4 | 5 | Unless overridden, these commands run on the `after_wp_config_load` hook, after wp-config.php has been loaded into scope. 6 | 7 | ### EXAMPLES 8 | 9 | # Create a new database. 10 | $ wp db create 11 | Success: Database created. 12 | 13 | # Drop an existing database. 14 | $ wp db drop --yes 15 | Success: Database dropped. 16 | 17 | # Reset the current database. 18 | $ wp db reset --yes 19 | Success: Database reset. 20 | 21 | # Execute a SQL query stored in a file. 22 | $ wp db query < debug.sql 23 | 24 | 25 | -------------------------------------------------------------------------------- /commands/db/prefix.md: -------------------------------------------------------------------------------- 1 | # wp db prefix 2 | 3 | Displays the database table prefix. 4 | 5 | Display the database table prefix, as defined by the database handler's interpretation of the current site. 6 | 7 | ### EXAMPLES 8 | 9 | $ wp db prefix 10 | wp_ 11 | 12 | ### GLOBAL PARAMETERS 13 | 14 | These [global parameters](https://make.wordpress.org/cli/handbook/config/) have the same behavior across all commands and affect how WP-CLI interacts with WordPress. 15 | 16 | | **Argument** | **Description** | 17 | |:----------------|:-----------------------------| 18 | | `--path=` | Path to the WordPress files. | 19 | | `--url=` | Pretend request came from given URL. In multisite, this argument is how the target site is specified. | 20 | | `--ssh=[:][@][:][]` | Perform operation against a remote server over SSH (or a container using scheme of "docker", "docker-compose", "docker-compose-run", "vagrant"). | 21 | | `--http=` | Perform operation against a remote WordPress installation over HTTP. | 22 | | `--user=` | Set the WordPress user. | 23 | | `--skip-plugins[=]` | Skip loading all plugins, or a comma-separated list of plugins. Note: mu-plugins are still loaded. | 24 | | `--skip-themes[=]` | Skip loading all themes, or a comma-separated list of themes. | 25 | | `--skip-packages` | Skip loading all installed packages. | 26 | | `--require=` | Load PHP file before running the command (may be used more than once). | 27 | | `--exec=` | Execute PHP code before running the command (may be used more than once). | 28 | | `--context=` | Load WordPress in a given context. | 29 | | `--[no-]color` | Whether to colorize the output. | 30 | | `--debug[=]` | Show all PHP errors and add verbosity to WP-CLI output. Built-in groups include: bootstrap, commandfactory, and help. | 31 | | `--prompt[=]` | Prompt the user to enter values for all command arguments, or a subset specified as comma-separated values. | 32 | | `--quiet` | Suppress informational messages. | 33 | -------------------------------------------------------------------------------- /commands/embed.md: -------------------------------------------------------------------------------- 1 | # wp embed 2 | 3 | Inspects oEmbed providers, clears embed cache, and more. 4 | 5 | ### EXAMPLES 6 | 7 | # Get embed HTML for a given URL. 8 | $ wp embed fetch https://www.youtube.com/watch?v=dQw4w9WgXcQ 9 | <iframe width="525" height="295" src="https://www.youtube.com/embed/dQw4w9WgXcQ?feature=oembed" ... 10 | 11 | # Find cache post ID for a given URL. 12 | $ wp embed cache find https://www.youtube.com/watch?v=dQw4w9WgXcQ --width=500 13 | 123 14 | 15 | # List format,endpoint fields of available providers. 16 | $ wp embed provider list 17 | +------------------------------+-----------------------------------------+ 18 | | format | endpoint | 19 | +------------------------------+-----------------------------------------+ 20 | | #https?://youtu\.be/.*#i | https://www.youtube.com/oembed | 21 | | #https?://flic\.kr/.*#i | https://www.flickr.com/services/oembed/ | 22 | | #https?://wordpress\.tv/.*#i | https://wordpress.tv/oembed/ | 23 | 24 | # List id,regex,priority fields of available handlers. 25 | $ wp embed handler list --fields=priority,id 26 | +----------+-------------------+ 27 | | priority | id | 28 | +----------+-------------------+ 29 | | 10 | youtube_embed_url | 30 | | 9999 | audio | 31 | | 9999 | video | 32 | +----------+-------------------+ 33 | 34 | 35 | -------------------------------------------------------------------------------- /commands/embed/cache.md: -------------------------------------------------------------------------------- 1 | # wp embed cache 2 | 3 | Finds, triggers, and deletes oEmbed caches. 4 | 5 | ### EXAMPLES 6 | 7 | # Find cache post ID for a given URL. 8 | $ wp embed cache find https://www.youtube.com/watch?v=dQw4w9WgXcQ --width=500 9 | 123 10 | 11 | # Clear cache for a post. 12 | $ wp embed cache clear 123 13 | Success: Cleared oEmbed cache. 14 | 15 | # Triggers cache for a post. 16 | $ wp embed cache trigger 456 17 | Success: Caching triggered! 18 | 19 | 20 | -------------------------------------------------------------------------------- /commands/embed/cache/clear.md: -------------------------------------------------------------------------------- 1 | # wp embed cache clear 2 | 3 | Deletes all oEmbed caches for a given post. 4 | 5 | oEmbed caches for a post are stored in the post's metadata. 6 | 7 | ### OPTIONS 8 | 9 | <post_id> 10 | : ID of the post to clear the cache for. 11 | 12 | ### EXAMPLES 13 | 14 | # Clear cache for a post 15 | $ wp embed cache clear 123 16 | Success: Cleared oEmbed cache. 17 | 18 | ### GLOBAL PARAMETERS 19 | 20 | These [global parameters](https://make.wordpress.org/cli/handbook/config/) have the same behavior across all commands and affect how WP-CLI interacts with WordPress. 21 | 22 | | **Argument** | **Description** | 23 | |:----------------|:-----------------------------| 24 | | `--path=` | Path to the WordPress files. | 25 | | `--url=` | Pretend request came from given URL. In multisite, this argument is how the target site is specified. | 26 | | `--ssh=[:][@][:][]` | Perform operation against a remote server over SSH (or a container using scheme of "docker", "docker-compose", "docker-compose-run", "vagrant"). | 27 | | `--http=` | Perform operation against a remote WordPress installation over HTTP. | 28 | | `--user=` | Set the WordPress user. | 29 | | `--skip-plugins[=]` | Skip loading all plugins, or a comma-separated list of plugins. Note: mu-plugins are still loaded. | 30 | | `--skip-themes[=]` | Skip loading all themes, or a comma-separated list of themes. | 31 | | `--skip-packages` | Skip loading all installed packages. | 32 | | `--require=` | Load PHP file before running the command (may be used more than once). | 33 | | `--exec=` | Execute PHP code before running the command (may be used more than once). | 34 | | `--context=` | Load WordPress in a given context. | 35 | | `--[no-]color` | Whether to colorize the output. | 36 | | `--debug[=]` | Show all PHP errors and add verbosity to WP-CLI output. Built-in groups include: bootstrap, commandfactory, and help. | 37 | | `--prompt[=]` | Prompt the user to enter values for all command arguments, or a subset specified as comma-separated values. | 38 | | `--quiet` | Suppress informational messages. | 39 | -------------------------------------------------------------------------------- /commands/embed/handler.md: -------------------------------------------------------------------------------- 1 | # wp embed handler 2 | 3 | Retrieves embed handlers. 4 | 5 | ### EXAMPLES 6 | 7 | # List id,regex,priority fields of available handlers. 8 | $ wp embed handler list --fields=priority,id 9 | +----------+-------------------+ 10 | | priority | id | 11 | +----------+-------------------+ 12 | | 10 | youtube_embed_url | 13 | | 9999 | audio | 14 | | 9999 | video | 15 | 16 | 17 | -------------------------------------------------------------------------------- /commands/embed/provider.md: -------------------------------------------------------------------------------- 1 | # wp embed provider 2 | 3 | Retrieves oEmbed providers. 4 | 5 | ### EXAMPLES 6 | 7 | # List format,endpoint fields of available providers. 8 | $ wp embed provider list 9 | +------------------------------+-----------------------------------------+ 10 | | format | endpoint | 11 | +------------------------------+-----------------------------------------+ 12 | | #https?://youtu\.be/.*#i | https://www.youtube.com/oembed | 13 | | #https?://flic\.kr/.*#i | https://www.flickr.com/services/oembed/ | 14 | | #https?://wordpress\.tv/.*#i | https://wordpress.tv/oembed/ | 15 | 16 | # Get the matching provider for the URL. 17 | $ wp embed provider match https://www.youtube.com/watch?v=dQw4w9WgXcQ 18 | https://www.youtube.com/oembed 19 | 20 | 21 | -------------------------------------------------------------------------------- /commands/help.md: -------------------------------------------------------------------------------- 1 | # wp help 2 | 3 | Gets help on WP-CLI, or on a specific command. 4 | 5 | ### OPTIONS 6 | 7 | [<command>...] 8 | : Get help on a specific command. 9 | 10 | ### EXAMPLES 11 | 12 | # get help for `core` command 13 | wp help core 14 | 15 | # get help for `core download` subcommand 16 | wp help core download 17 | 18 | ### GLOBAL PARAMETERS 19 | 20 | These [global parameters](https://make.wordpress.org/cli/handbook/config/) have the same behavior across all commands and affect how WP-CLI interacts with WordPress. 21 | 22 | | **Argument** | **Description** | 23 | |:----------------|:-----------------------------| 24 | | `--path=` | Path to the WordPress files. | 25 | | `--url=` | Pretend request came from given URL. In multisite, this argument is how the target site is specified. | 26 | | `--ssh=[:][@][:][]` | Perform operation against a remote server over SSH (or a container using scheme of "docker", "docker-compose", "docker-compose-run", "vagrant"). | 27 | | `--http=` | Perform operation against a remote WordPress installation over HTTP. | 28 | | `--user=` | Set the WordPress user. | 29 | | `--skip-plugins[=]` | Skip loading all plugins, or a comma-separated list of plugins. Note: mu-plugins are still loaded. | 30 | | `--skip-themes[=]` | Skip loading all themes, or a comma-separated list of themes. | 31 | | `--skip-packages` | Skip loading all installed packages. | 32 | | `--require=` | Load PHP file before running the command (may be used more than once). | 33 | | `--exec=` | Execute PHP code before running the command (may be used more than once). | 34 | | `--context=` | Load WordPress in a given context. | 35 | | `--[no-]color` | Whether to colorize the output. | 36 | | `--debug[=]` | Show all PHP errors and add verbosity to WP-CLI output. Built-in groups include: bootstrap, commandfactory, and help. | 37 | | `--prompt[=]` | Prompt the user to enter values for all command arguments, or a subset specified as comma-separated values. | 38 | | `--quiet` | Suppress informational messages. | 39 | -------------------------------------------------------------------------------- /commands/i18n.md: -------------------------------------------------------------------------------- 1 | # wp i18n 2 | 3 | Provides internationalization tools for WordPress projects. 4 | 5 | Unless overridden, these commands run on the `before_wp_load` hook, just before the WP load process begins. 6 | 7 | ### EXAMPLES 8 | 9 | # Create a POT file for the WordPress plugin/theme in the current directory 10 | $ wp i18n make-pot . languages/my-plugin.pot 11 | 12 | 13 | -------------------------------------------------------------------------------- /commands/language.md: -------------------------------------------------------------------------------- 1 | # wp language 2 | 3 | Installs, activates, and manages language packs. 4 | 5 | ### EXAMPLES 6 | 7 | # Install the Dutch core language pack. 8 | $ wp language core install nl_NL 9 | Downloading translation from https://downloads.wordpress.org/translation/core/6.4.3/nl_NL.zip... 10 | Unpacking the update... 11 | Installing the latest version... 12 | Removing the old version of the translation... 13 | Translation updated successfully. 14 | Language 'nl_NL' installed. 15 | Success: Installed 1 of 1 languages. 16 | 17 | # Activate the Dutch core language pack. 18 | $ wp site switch-language nl_NL 19 | Success: Language activated. 20 | 21 | # Install the Dutch theme language pack for Twenty Ten. 22 | $ wp language theme install twentyten nl_NL 23 | Downloading translation from https://downloads.wordpress.org/translation/theme/twentyten/4.0/nl_NL.zip... 24 | Unpacking the update... 25 | Installing the latest version... 26 | Removing the old version of the translation... 27 | Translation updated successfully. 28 | Language 'nl_NL' installed. 29 | Success: Installed 1 of 1 languages. 30 | 31 | # Install the Dutch plugin language pack for Hello Dolly. 32 | $ wp language plugin install hello-dolly nl_NL 33 | Downloading translation from https://downloads.wordpress.org/translation/plugin/hello-dolly/1.7.2/nl_NL.zip... 34 | Unpacking the update... 35 | Installing the latest version... 36 | Removing the old version of the translation... 37 | Translation updated successfully. 38 | Language 'nl_NL' installed. 39 | Success: Installed 1 of 1 languages. 40 | 41 | 42 | -------------------------------------------------------------------------------- /commands/language/core.md: -------------------------------------------------------------------------------- 1 | # wp language core 2 | 3 | Installs, activates, and manages core language packs. 4 | 5 | ### EXAMPLES 6 | 7 | # Install the Dutch core language pack. 8 | $ wp language core install nl_NL 9 | Downloading translation from https://downloads.wordpress.org/translation/core/6.4.3/nl_NL.zip... 10 | Unpacking the update... 11 | Installing the latest version... 12 | Removing the old version of the translation... 13 | Translation updated successfully. 14 | Language 'nl_NL' installed. 15 | Success: Installed 1 of 1 languages. 16 | 17 | # Activate the Dutch core language pack. 18 | $ wp site switch-language nl_NL 19 | Success: Language activated. 20 | 21 | # Uninstall the Dutch core language pack. 22 | $ wp language core uninstall nl_NL 23 | Success: Language uninstalled. 24 | 25 | # List installed core language packs. 26 | $ wp language core list --status=installed 27 | +----------+--------------+-------------+-----------+-----------+---------------------+ 28 | | language | english_name | native_name | status | update | updated | 29 | +----------+--------------+-------------+-----------+-----------+---------------------+ 30 | | nl_NL | Dutch | Nederlands | installed | available | 2024-01-31 10:24:06 | 31 | +----------+--------------+-------------+-----------+-----------+---------------------+ 32 | 33 | 34 | -------------------------------------------------------------------------------- /commands/language/core/uninstall.md: -------------------------------------------------------------------------------- 1 | # wp language core uninstall 2 | 3 | Uninstalls a given language. 4 | 5 | ### OPTIONS 6 | 7 | <language>... 8 | : Language code to uninstall. 9 | 10 | ### EXAMPLES 11 | 12 | # Uninstall the Japanese core language pack. 13 | $ wp language core uninstall ja 14 | Success: Language uninstalled. 15 | 16 | ### GLOBAL PARAMETERS 17 | 18 | These [global parameters](https://make.wordpress.org/cli/handbook/config/) have the same behavior across all commands and affect how WP-CLI interacts with WordPress. 19 | 20 | | **Argument** | **Description** | 21 | |:----------------|:-----------------------------| 22 | | `--path=` | Path to the WordPress files. | 23 | | `--url=` | Pretend request came from given URL. In multisite, this argument is how the target site is specified. | 24 | | `--ssh=[:][@][:][]` | Perform operation against a remote server over SSH (or a container using scheme of "docker", "docker-compose", "docker-compose-run", "vagrant"). | 25 | | `--http=` | Perform operation against a remote WordPress installation over HTTP. | 26 | | `--user=` | Set the WordPress user. | 27 | | `--skip-plugins[=]` | Skip loading all plugins, or a comma-separated list of plugins. Note: mu-plugins are still loaded. | 28 | | `--skip-themes[=]` | Skip loading all themes, or a comma-separated list of themes. | 29 | | `--skip-packages` | Skip loading all installed packages. | 30 | | `--require=` | Load PHP file before running the command (may be used more than once). | 31 | | `--exec=` | Execute PHP code before running the command (may be used more than once). | 32 | | `--context=` | Load WordPress in a given context. | 33 | | `--[no-]color` | Whether to colorize the output. | 34 | | `--debug[=]` | Show all PHP errors and add verbosity to WP-CLI output. Built-in groups include: bootstrap, commandfactory, and help. | 35 | | `--prompt[=]` | Prompt the user to enter values for all command arguments, or a subset specified as comma-separated values. | 36 | | `--quiet` | Suppress informational messages. | 37 | -------------------------------------------------------------------------------- /commands/language/plugin.md: -------------------------------------------------------------------------------- 1 | # wp language plugin 2 | 3 | Installs, activates, and manages plugin language packs. 4 | 5 | ### EXAMPLES 6 | 7 | # Install the Dutch plugin language pack for Hello Dolly. 8 | $ wp language plugin install hello-dolly nl_NL 9 | Downloading translation from https://downloads.wordpress.org/translation/plugin/hello-dolly/1.7.2/nl_NL.zip... 10 | Unpacking the update... 11 | Installing the latest version... 12 | Removing the old version of the translation... 13 | Translation updated successfully. 14 | Language 'nl_NL' installed. 15 | Success: Installed 1 of 1 languages. 16 | 17 | # Uninstall the Dutch plugin language pack for Hello Dolly. 18 | $ wp language plugin uninstall hello-dolly nl_NL 19 | Language 'nl_NL' for 'hello-dolly' uninstalled. 20 | +-------------+--------+-------------+ 21 | | name | locale | status | 22 | +-------------+--------+-------------+ 23 | | hello-dolly | nl_NL | uninstalled | 24 | +-------------+--------+-------------+ 25 | Success: Uninstalled 1 of 1 languages. 26 | 27 | # List installed plugin language packs for Hello Dolly. 28 | $ wp language plugin list hello-dolly --status=installed 29 | +-------------+----------+--------------+-------------+-----------+--------+---------------------+ 30 | | plugin | language | english_name | native_name | status | update | updated | 31 | +-------------+----------+--------------+-------------+-----------+--------+---------------------+ 32 | | hello-dolly | nl_NL | Dutch | Nederlands | installed | none | 2023-11-13 12:34:15 | 33 | +-------------+----------+--------------+-------------+-----------+--------+---------------------+ 34 | 35 | 36 | -------------------------------------------------------------------------------- /commands/language/theme.md: -------------------------------------------------------------------------------- 1 | # wp language theme 2 | 3 | Installs, activates, and manages theme language packs. 4 | 5 | ### EXAMPLES 6 | 7 | # Install the Dutch theme language pack for Twenty Ten. 8 | $ wp language theme install twentyten nl_NL 9 | Downloading translation from https://downloads.wordpress.org/translation/theme/twentyten/4.0/nl_NL.zip... 10 | Unpacking the update... 11 | Installing the latest version... 12 | Removing the old version of the translation... 13 | Translation updated successfully. 14 | Language 'nl_NL' installed. 15 | Success: Installed 1 of 1 languages. 16 | 17 | # Uninstall the Dutch theme language pack for Twenty Ten. 18 | $ wp language theme uninstall twentyten nl_NL 19 | Language 'nl_NL' for 'twentyten' uninstalled. 20 | +-----------+--------+-------------+ 21 | | name | locale | status | 22 | +-----------+--------+-------------+ 23 | | twentyten | nl_NL | uninstalled | 24 | +-----------+--------+-------------+ 25 | Success: Uninstalled 1 of 1 languages. 26 | 27 | # List installed theme language packs for Twenty Ten. 28 | $ wp language theme list twentyten --status=installed 29 | +-----------+----------+--------------+-------------+-----------+--------+---------------------+ 30 | | theme | language | english_name | native_name | status | update | updated | 31 | +-----------+----------+--------------+-------------+-----------+--------+---------------------+ 32 | | twentyten | nl_NL | Dutch | Nederlands | installed | none | 2023-12-29 21:21:39 | 33 | +-----------+----------+--------------+-------------+-----------+--------+---------------------+ 34 | 35 | 36 | -------------------------------------------------------------------------------- /commands/maintenance-mode.md: -------------------------------------------------------------------------------- 1 | # wp maintenance-mode 2 | 3 | Activates, deactivates or checks the status of the maintenance mode of a site. 4 | 5 | ### EXAMPLES 6 | 7 | # Activate Maintenance mode. 8 | $ wp maintenance-mode activate 9 | Enabling Maintenance mode... 10 | Success: Activated Maintenance mode. 11 | 12 | # Deactivate Maintenance mode. 13 | $ wp maintenance-mode deactivate 14 | Disabling Maintenance mode... 15 | Success: Deactivated Maintenance mode. 16 | 17 | # Display Maintenance mode status. 18 | $ wp maintenance-mode status 19 | Maintenance mode is active. 20 | 21 | # Get Maintenance mode status for scripting purpose. 22 | $ wp maintenance-mode is-active 23 | $ echo $? 24 | 1 25 | 26 | 27 | -------------------------------------------------------------------------------- /commands/maintenance-mode/activate.md: -------------------------------------------------------------------------------- 1 | # wp maintenance-mode activate 2 | 3 | Activates maintenance mode. 4 | 5 | ### OPTIONS 6 | 7 | [\--force] 8 | : Force maintenance mode activation operation. 9 | 10 | ### EXAMPLES 11 | 12 | $ wp maintenance-mode activate 13 | Enabling Maintenance mode... 14 | Success: Activated Maintenance mode. 15 | 16 | ### GLOBAL PARAMETERS 17 | 18 | These [global parameters](https://make.wordpress.org/cli/handbook/config/) have the same behavior across all commands and affect how WP-CLI interacts with WordPress. 19 | 20 | | **Argument** | **Description** | 21 | |:----------------|:-----------------------------| 22 | | `--path=` | Path to the WordPress files. | 23 | | `--url=` | Pretend request came from given URL. In multisite, this argument is how the target site is specified. | 24 | | `--ssh=[:][@][:][]` | Perform operation against a remote server over SSH (or a container using scheme of "docker", "docker-compose", "docker-compose-run", "vagrant"). | 25 | | `--http=` | Perform operation against a remote WordPress installation over HTTP. | 26 | | `--user=` | Set the WordPress user. | 27 | | `--skip-plugins[=]` | Skip loading all plugins, or a comma-separated list of plugins. Note: mu-plugins are still loaded. | 28 | | `--skip-themes[=]` | Skip loading all themes, or a comma-separated list of themes. | 29 | | `--skip-packages` | Skip loading all installed packages. | 30 | | `--require=` | Load PHP file before running the command (may be used more than once). | 31 | | `--exec=` | Execute PHP code before running the command (may be used more than once). | 32 | | `--context=` | Load WordPress in a given context. | 33 | | `--[no-]color` | Whether to colorize the output. | 34 | | `--debug[=]` | Show all PHP errors and add verbosity to WP-CLI output. Built-in groups include: bootstrap, commandfactory, and help. | 35 | | `--prompt[=]` | Prompt the user to enter values for all command arguments, or a subset specified as comma-separated values. | 36 | | `--quiet` | Suppress informational messages. | 37 | -------------------------------------------------------------------------------- /commands/maintenance-mode/deactivate.md: -------------------------------------------------------------------------------- 1 | # wp maintenance-mode deactivate 2 | 3 | Deactivates maintenance mode. 4 | 5 | ### EXAMPLES 6 | 7 | $ wp maintenance-mode deactivate 8 | Disabling Maintenance mode... 9 | Success: Deactivated Maintenance mode. 10 | 11 | ### GLOBAL PARAMETERS 12 | 13 | These [global parameters](https://make.wordpress.org/cli/handbook/config/) have the same behavior across all commands and affect how WP-CLI interacts with WordPress. 14 | 15 | | **Argument** | **Description** | 16 | |:----------------|:-----------------------------| 17 | | `--path=` | Path to the WordPress files. | 18 | | `--url=` | Pretend request came from given URL. In multisite, this argument is how the target site is specified. | 19 | | `--ssh=[:][@][:][]` | Perform operation against a remote server over SSH (or a container using scheme of "docker", "docker-compose", "docker-compose-run", "vagrant"). | 20 | | `--http=` | Perform operation against a remote WordPress installation over HTTP. | 21 | | `--user=` | Set the WordPress user. | 22 | | `--skip-plugins[=]` | Skip loading all plugins, or a comma-separated list of plugins. Note: mu-plugins are still loaded. | 23 | | `--skip-themes[=]` | Skip loading all themes, or a comma-separated list of themes. | 24 | | `--skip-packages` | Skip loading all installed packages. | 25 | | `--require=` | Load PHP file before running the command (may be used more than once). | 26 | | `--exec=` | Execute PHP code before running the command (may be used more than once). | 27 | | `--context=` | Load WordPress in a given context. | 28 | | `--[no-]color` | Whether to colorize the output. | 29 | | `--debug[=]` | Show all PHP errors and add verbosity to WP-CLI output. Built-in groups include: bootstrap, commandfactory, and help. | 30 | | `--prompt[=]` | Prompt the user to enter values for all command arguments, or a subset specified as comma-separated values. | 31 | | `--quiet` | Suppress informational messages. | 32 | -------------------------------------------------------------------------------- /commands/maintenance-mode/is-active.md: -------------------------------------------------------------------------------- 1 | # wp maintenance-mode is-active 2 | 3 | Detects maintenance mode status. 4 | 5 | ### EXAMPLES 6 | 7 | $ wp maintenance-mode is-active 8 | $ echo $? 9 | 1 10 | 11 | ### GLOBAL PARAMETERS 12 | 13 | These [global parameters](https://make.wordpress.org/cli/handbook/config/) have the same behavior across all commands and affect how WP-CLI interacts with WordPress. 14 | 15 | | **Argument** | **Description** | 16 | |:----------------|:-----------------------------| 17 | | `--path=` | Path to the WordPress files. | 18 | | `--url=` | Pretend request came from given URL. In multisite, this argument is how the target site is specified. | 19 | | `--ssh=[:][@][:][]` | Perform operation against a remote server over SSH (or a container using scheme of "docker", "docker-compose", "docker-compose-run", "vagrant"). | 20 | | `--http=` | Perform operation against a remote WordPress installation over HTTP. | 21 | | `--user=` | Set the WordPress user. | 22 | | `--skip-plugins[=]` | Skip loading all plugins, or a comma-separated list of plugins. Note: mu-plugins are still loaded. | 23 | | `--skip-themes[=]` | Skip loading all themes, or a comma-separated list of themes. | 24 | | `--skip-packages` | Skip loading all installed packages. | 25 | | `--require=` | Load PHP file before running the command (may be used more than once). | 26 | | `--exec=` | Execute PHP code before running the command (may be used more than once). | 27 | | `--context=` | Load WordPress in a given context. | 28 | | `--[no-]color` | Whether to colorize the output. | 29 | | `--debug[=]` | Show all PHP errors and add verbosity to WP-CLI output. Built-in groups include: bootstrap, commandfactory, and help. | 30 | | `--prompt[=]` | Prompt the user to enter values for all command arguments, or a subset specified as comma-separated values. | 31 | | `--quiet` | Suppress informational messages. | 32 | -------------------------------------------------------------------------------- /commands/maintenance-mode/status.md: -------------------------------------------------------------------------------- 1 | # wp maintenance-mode status 2 | 3 | Displays maintenance mode status. 4 | 5 | ### EXAMPLES 6 | 7 | $ wp maintenance-mode status 8 | Maintenance mode is active. 9 | 10 | ### GLOBAL PARAMETERS 11 | 12 | These [global parameters](https://make.wordpress.org/cli/handbook/config/) have the same behavior across all commands and affect how WP-CLI interacts with WordPress. 13 | 14 | | **Argument** | **Description** | 15 | |:----------------|:-----------------------------| 16 | | `--path=` | Path to the WordPress files. | 17 | | `--url=` | Pretend request came from given URL. In multisite, this argument is how the target site is specified. | 18 | | `--ssh=[:][@][:][]` | Perform operation against a remote server over SSH (or a container using scheme of "docker", "docker-compose", "docker-compose-run", "vagrant"). | 19 | | `--http=` | Perform operation against a remote WordPress installation over HTTP. | 20 | | `--user=` | Set the WordPress user. | 21 | | `--skip-plugins[=]` | Skip loading all plugins, or a comma-separated list of plugins. Note: mu-plugins are still loaded. | 22 | | `--skip-themes[=]` | Skip loading all themes, or a comma-separated list of themes. | 23 | | `--skip-packages` | Skip loading all installed packages. | 24 | | `--require=` | Load PHP file before running the command (may be used more than once). | 25 | | `--exec=` | Execute PHP code before running the command (may be used more than once). | 26 | | `--context=` | Load WordPress in a given context. | 27 | | `--[no-]color` | Whether to colorize the output. | 28 | | `--debug[=]` | Show all PHP errors and add verbosity to WP-CLI output. Built-in groups include: bootstrap, commandfactory, and help. | 29 | | `--prompt[=]` | Prompt the user to enter values for all command arguments, or a subset specified as comma-separated values. | 30 | | `--quiet` | Suppress informational messages. | 31 | -------------------------------------------------------------------------------- /commands/media.md: -------------------------------------------------------------------------------- 1 | # wp media 2 | 3 | Imports files as attachments, regenerates thumbnails, or lists registered image sizes. 4 | 5 | ### EXAMPLES 6 | 7 | # Re-generate all thumbnails, without confirmation. 8 | $ wp media regenerate --yes 9 | Found 3 images to regenerate. 10 | 1/3 Regenerated thumbnails for "Sydney Harbor Bridge" (ID 760). 11 | 2/3 Regenerated thumbnails for "Boardwalk" (ID 757). 12 | 3/3 Regenerated thumbnails for "Sunburst Over River" (ID 756). 13 | Success: Regenerated 3 of 3 images. 14 | 15 | # Import a local image and set it to be the featured image for a post. 16 | $ wp media import ~/Downloads/image.png --post_id=123 --title="A downloaded picture" --featured_image 17 | Imported file '/home/person/Downloads/image.png' as attachment ID 1753 and attached to post 123 as featured image. 18 | Success: Imported 1 of 1 images. 19 | 20 | # List all registered image sizes 21 | $ wp media image-size 22 | +---------------------------+-------+--------+-------+ 23 | | name | width | height | crop | 24 | +---------------------------+-------+--------+-------+ 25 | | full | | | N/A | 26 | | twentyfourteen-full-width | 1038 | 576 | hard | 27 | | large | 1024 | 1024 | soft | 28 | | medium_large | 768 | 0 | soft | 29 | | medium | 300 | 300 | soft | 30 | | thumbnail | 150 | 150 | hard | 31 | +---------------------------+-------+--------+-------+ 32 | 33 | # Fix orientation for specific images. 34 | $ wp media fix-orientation 63 35 | 1/1 Fixing orientation for "Portrait_6" (ID 63). 36 | Success: Fixed 1 of 1 images. 37 | 38 | 39 | -------------------------------------------------------------------------------- /commands/menu.md: -------------------------------------------------------------------------------- 1 | # wp menu 2 | 3 | Lists, creates, assigns, and deletes the active theme's navigation menus. 4 | 5 | See the [Navigation Menus](https://developer.wordpress.org/themes/functionality/navigation-menus/) reference in the Theme Handbook. 6 | 7 | ### EXAMPLES 8 | 9 | # Create a new menu 10 | $ wp menu create "My Menu" 11 | Success: Created menu 200. 12 | 13 | # List existing menus 14 | $ wp menu list 15 | +---------+----------+----------+-----------+-------+ 16 | | term_id | name | slug | locations | count | 17 | +---------+----------+----------+-----------+-------+ 18 | | 200 | My Menu | my-menu | | 0 | 19 | | 177 | Top Menu | top-menu | primary | 7 | 20 | +---------+----------+----------+-----------+-------+ 21 | 22 | # Create a new menu link item 23 | $ wp menu item add-custom my-menu Apple http://apple.com --porcelain 24 | 1922 25 | 26 | # Assign the 'my-menu' menu to the 'primary' location 27 | $ wp menu location assign my-menu primary 28 | Success: Assigned location primary to menu my-menu. 29 | 30 | 31 | -------------------------------------------------------------------------------- /commands/menu/create.md: -------------------------------------------------------------------------------- 1 | # wp menu create 2 | 3 | Creates a new menu. 4 | 5 | ### OPTIONS 6 | 7 | <menu-name> 8 | : A descriptive name for the menu. 9 | 10 | [\--porcelain] 11 | : Output just the new menu id. 12 | 13 | ### EXAMPLES 14 | 15 | $ wp menu create "My Menu" 16 | Success: Created menu 200. 17 | 18 | ### GLOBAL PARAMETERS 19 | 20 | These [global parameters](https://make.wordpress.org/cli/handbook/config/) have the same behavior across all commands and affect how WP-CLI interacts with WordPress. 21 | 22 | | **Argument** | **Description** | 23 | |:----------------|:-----------------------------| 24 | | `--path=` | Path to the WordPress files. | 25 | | `--url=` | Pretend request came from given URL. In multisite, this argument is how the target site is specified. | 26 | | `--ssh=[:][@][:][]` | Perform operation against a remote server over SSH (or a container using scheme of "docker", "docker-compose", "docker-compose-run", "vagrant"). | 27 | | `--http=` | Perform operation against a remote WordPress installation over HTTP. | 28 | | `--user=` | Set the WordPress user. | 29 | | `--skip-plugins[=]` | Skip loading all plugins, or a comma-separated list of plugins. Note: mu-plugins are still loaded. | 30 | | `--skip-themes[=]` | Skip loading all themes, or a comma-separated list of themes. | 31 | | `--skip-packages` | Skip loading all installed packages. | 32 | | `--require=` | Load PHP file before running the command (may be used more than once). | 33 | | `--exec=` | Execute PHP code before running the command (may be used more than once). | 34 | | `--context=` | Load WordPress in a given context. | 35 | | `--[no-]color` | Whether to colorize the output. | 36 | | `--debug[=]` | Show all PHP errors and add verbosity to WP-CLI output. Built-in groups include: bootstrap, commandfactory, and help. | 37 | | `--prompt[=]` | Prompt the user to enter values for all command arguments, or a subset specified as comma-separated values. | 38 | | `--quiet` | Suppress informational messages. | 39 | -------------------------------------------------------------------------------- /commands/menu/delete.md: -------------------------------------------------------------------------------- 1 | # wp menu delete 2 | 3 | Deletes one or more menus. 4 | 5 | ### OPTIONS 6 | 7 | <menu>... 8 | : The name, slug, or term ID for the menu(s). 9 | 10 | ### EXAMPLES 11 | 12 | $ wp menu delete "My Menu" 13 | Deleted menu 'My Menu'. 14 | Success: Deleted 1 of 1 menus. 15 | 16 | ### GLOBAL PARAMETERS 17 | 18 | These [global parameters](https://make.wordpress.org/cli/handbook/config/) have the same behavior across all commands and affect how WP-CLI interacts with WordPress. 19 | 20 | | **Argument** | **Description** | 21 | |:----------------|:-----------------------------| 22 | | `--path=` | Path to the WordPress files. | 23 | | `--url=` | Pretend request came from given URL. In multisite, this argument is how the target site is specified. | 24 | | `--ssh=[:][@][:][]` | Perform operation against a remote server over SSH (or a container using scheme of "docker", "docker-compose", "docker-compose-run", "vagrant"). | 25 | | `--http=` | Perform operation against a remote WordPress installation over HTTP. | 26 | | `--user=` | Set the WordPress user. | 27 | | `--skip-plugins[=]` | Skip loading all plugins, or a comma-separated list of plugins. Note: mu-plugins are still loaded. | 28 | | `--skip-themes[=]` | Skip loading all themes, or a comma-separated list of themes. | 29 | | `--skip-packages` | Skip loading all installed packages. | 30 | | `--require=` | Load PHP file before running the command (may be used more than once). | 31 | | `--exec=` | Execute PHP code before running the command (may be used more than once). | 32 | | `--context=` | Load WordPress in a given context. | 33 | | `--[no-]color` | Whether to colorize the output. | 34 | | `--debug[=]` | Show all PHP errors and add verbosity to WP-CLI output. Built-in groups include: bootstrap, commandfactory, and help. | 35 | | `--prompt[=]` | Prompt the user to enter values for all command arguments, or a subset specified as comma-separated values. | 36 | | `--quiet` | Suppress informational messages. | 37 | -------------------------------------------------------------------------------- /commands/menu/item.md: -------------------------------------------------------------------------------- 1 | # wp menu item 2 | 3 | List, add, and delete items associated with a menu. 4 | 5 | ### EXAMPLES 6 | 7 | # Add an existing post to an existing menu 8 | $ wp menu item add-post sidebar-menu 33 --title="Custom Test Post" 9 | Success: Menu item added. 10 | 11 | # Create a new menu link item 12 | $ wp menu item add-custom sidebar-menu Apple http://apple.com 13 | Success: Menu item added. 14 | 15 | # Delete menu item 16 | $ wp menu item delete 45 17 | Success: Deleted 1 of 1 menu items. 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /commands/menu/item/delete.md: -------------------------------------------------------------------------------- 1 | # wp menu item delete 2 | 3 | Deletes one or more items from a menu. 4 | 5 | ### OPTIONS 6 | 7 | <db-id>... 8 | : Database ID for the menu item(s). 9 | 10 | ### EXAMPLES 11 | 12 | $ wp menu item delete 45 13 | Success: Deleted 1 of 1 menu items. 14 | 15 | ### GLOBAL PARAMETERS 16 | 17 | These [global parameters](https://make.wordpress.org/cli/handbook/config/) have the same behavior across all commands and affect how WP-CLI interacts with WordPress. 18 | 19 | | **Argument** | **Description** | 20 | |:----------------|:-----------------------------| 21 | | `--path=` | Path to the WordPress files. | 22 | | `--url=` | Pretend request came from given URL. In multisite, this argument is how the target site is specified. | 23 | | `--ssh=[:][@][:][]` | Perform operation against a remote server over SSH (or a container using scheme of "docker", "docker-compose", "docker-compose-run", "vagrant"). | 24 | | `--http=` | Perform operation against a remote WordPress installation over HTTP. | 25 | | `--user=` | Set the WordPress user. | 26 | | `--skip-plugins[=]` | Skip loading all plugins, or a comma-separated list of plugins. Note: mu-plugins are still loaded. | 27 | | `--skip-themes[=]` | Skip loading all themes, or a comma-separated list of themes. | 28 | | `--skip-packages` | Skip loading all installed packages. | 29 | | `--require=` | Load PHP file before running the command (may be used more than once). | 30 | | `--exec=` | Execute PHP code before running the command (may be used more than once). | 31 | | `--context=` | Load WordPress in a given context. | 32 | | `--[no-]color` | Whether to colorize the output. | 33 | | `--debug[=]` | Show all PHP errors and add verbosity to WP-CLI output. Built-in groups include: bootstrap, commandfactory, and help. | 34 | | `--prompt[=]` | Prompt the user to enter values for all command arguments, or a subset specified as comma-separated values. | 35 | | `--quiet` | Suppress informational messages. | 36 | -------------------------------------------------------------------------------- /commands/menu/location.md: -------------------------------------------------------------------------------- 1 | # wp menu location 2 | 3 | Assigns, removes, and lists a menu's locations. 4 | 5 | ### EXAMPLES 6 | 7 | # List available menu locations 8 | $ wp menu location list 9 | +----------+-------------------+ 10 | | location | description | 11 | +----------+-------------------+ 12 | | primary | Primary Menu | 13 | | social | Social Links Menu | 14 | +----------+-------------------+ 15 | 16 | # Assign the 'primary-menu' menu to the 'primary' location 17 | $ wp menu location assign primary-menu primary 18 | Success: Assigned location primary to menu primary-menu. 19 | 20 | # Remove the 'primary-menu' menu from the 'primary' location 21 | $ wp menu location remove primary-menu primary 22 | Success: Removed location from menu. 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /commands/menu/location/assign.md: -------------------------------------------------------------------------------- 1 | # wp menu location assign 2 | 3 | Assigns a location to a menu. 4 | 5 | ### OPTIONS 6 | 7 | <menu> 8 | : The name, slug, or term ID for the menu. 9 | 10 | <location> 11 | : Location's slug. 12 | 13 | ### EXAMPLES 14 | 15 | $ wp menu location assign primary-menu primary 16 | Success: Assigned location primary to menu primary-menu. 17 | 18 | ### GLOBAL PARAMETERS 19 | 20 | These [global parameters](https://make.wordpress.org/cli/handbook/config/) have the same behavior across all commands and affect how WP-CLI interacts with WordPress. 21 | 22 | | **Argument** | **Description** | 23 | |:----------------|:-----------------------------| 24 | | `--path=` | Path to the WordPress files. | 25 | | `--url=` | Pretend request came from given URL. In multisite, this argument is how the target site is specified. | 26 | | `--ssh=[:][@][:][]` | Perform operation against a remote server over SSH (or a container using scheme of "docker", "docker-compose", "docker-compose-run", "vagrant"). | 27 | | `--http=` | Perform operation against a remote WordPress installation over HTTP. | 28 | | `--user=` | Set the WordPress user. | 29 | | `--skip-plugins[=]` | Skip loading all plugins, or a comma-separated list of plugins. Note: mu-plugins are still loaded. | 30 | | `--skip-themes[=]` | Skip loading all themes, or a comma-separated list of themes. | 31 | | `--skip-packages` | Skip loading all installed packages. | 32 | | `--require=` | Load PHP file before running the command (may be used more than once). | 33 | | `--exec=` | Execute PHP code before running the command (may be used more than once). | 34 | | `--context=` | Load WordPress in a given context. | 35 | | `--[no-]color` | Whether to colorize the output. | 36 | | `--debug[=]` | Show all PHP errors and add verbosity to WP-CLI output. Built-in groups include: bootstrap, commandfactory, and help. | 37 | | `--prompt[=]` | Prompt the user to enter values for all command arguments, or a subset specified as comma-separated values. | 38 | | `--quiet` | Suppress informational messages. | 39 | -------------------------------------------------------------------------------- /commands/menu/location/remove.md: -------------------------------------------------------------------------------- 1 | # wp menu location remove 2 | 3 | Removes a location from a menu. 4 | 5 | ### OPTIONS 6 | 7 | <menu> 8 | : The name, slug, or term ID for the menu. 9 | 10 | <location> 11 | : Location's slug. 12 | 13 | ### EXAMPLES 14 | 15 | $ wp menu location remove primary-menu primary 16 | Success: Removed location from menu. 17 | 18 | ### GLOBAL PARAMETERS 19 | 20 | These [global parameters](https://make.wordpress.org/cli/handbook/config/) have the same behavior across all commands and affect how WP-CLI interacts with WordPress. 21 | 22 | | **Argument** | **Description** | 23 | |:----------------|:-----------------------------| 24 | | `--path=` | Path to the WordPress files. | 25 | | `--url=` | Pretend request came from given URL. In multisite, this argument is how the target site is specified. | 26 | | `--ssh=[:][@][:][]` | Perform operation against a remote server over SSH (or a container using scheme of "docker", "docker-compose", "docker-compose-run", "vagrant"). | 27 | | `--http=` | Perform operation against a remote WordPress installation over HTTP. | 28 | | `--user=` | Set the WordPress user. | 29 | | `--skip-plugins[=]` | Skip loading all plugins, or a comma-separated list of plugins. Note: mu-plugins are still loaded. | 30 | | `--skip-themes[=]` | Skip loading all themes, or a comma-separated list of themes. | 31 | | `--skip-packages` | Skip loading all installed packages. | 32 | | `--require=` | Load PHP file before running the command (may be used more than once). | 33 | | `--exec=` | Execute PHP code before running the command (may be used more than once). | 34 | | `--context=` | Load WordPress in a given context. | 35 | | `--[no-]color` | Whether to colorize the output. | 36 | | `--debug[=]` | Show all PHP errors and add verbosity to WP-CLI output. Built-in groups include: bootstrap, commandfactory, and help. | 37 | | `--prompt[=]` | Prompt the user to enter values for all command arguments, or a subset specified as comma-separated values. | 38 | | `--quiet` | Suppress informational messages. | 39 | -------------------------------------------------------------------------------- /commands/network.md: -------------------------------------------------------------------------------- 1 | # wp network 2 | 3 | Perform network-wide operations. 4 | 5 | ### EXAMPLES 6 | 7 | # Get a list of super-admins 8 | $ wp network meta get 1 site_admins 9 | array ( 10 | 0 => 'supervisor', 11 | ) 12 | 13 | 14 | -------------------------------------------------------------------------------- /commands/network/meta.md: -------------------------------------------------------------------------------- 1 | # wp network meta 2 | 3 | Gets, adds, updates, deletes, and lists network custom fields. 4 | 5 | ### EXAMPLES 6 | 7 | # Get a list of super-admins 8 | $ wp network meta get 1 site_admins 9 | array ( 10 | 0 => 'supervisor', 11 | ) 12 | 13 | 14 | -------------------------------------------------------------------------------- /commands/network/meta/delete.md: -------------------------------------------------------------------------------- 1 | # wp network meta delete 2 | 3 | Delete a meta field. 4 | 5 | ### OPTIONS 6 | 7 | <id> 8 | : The ID of the object. 9 | 10 | [<key>] 11 | : The name of the meta field to delete. 12 | 13 | [<value>] 14 | : The value to delete. If omitted, all rows with key will deleted. 15 | 16 | [\--all] 17 | : Delete all meta for the object. 18 | 19 | ### GLOBAL PARAMETERS 20 | 21 | These [global parameters](https://make.wordpress.org/cli/handbook/config/) have the same behavior across all commands and affect how WP-CLI interacts with WordPress. 22 | 23 | | **Argument** | **Description** | 24 | |:----------------|:-----------------------------| 25 | | `--path=` | Path to the WordPress files. | 26 | | `--url=` | Pretend request came from given URL. In multisite, this argument is how the target site is specified. | 27 | | `--ssh=[:][@][:][]` | Perform operation against a remote server over SSH (or a container using scheme of "docker", "docker-compose", "docker-compose-run", "vagrant"). | 28 | | `--http=` | Perform operation against a remote WordPress installation over HTTP. | 29 | | `--user=` | Set the WordPress user. | 30 | | `--skip-plugins[=]` | Skip loading all plugins, or a comma-separated list of plugins. Note: mu-plugins are still loaded. | 31 | | `--skip-themes[=]` | Skip loading all themes, or a comma-separated list of themes. | 32 | | `--skip-packages` | Skip loading all installed packages. | 33 | | `--require=` | Load PHP file before running the command (may be used more than once). | 34 | | `--exec=` | Execute PHP code before running the command (may be used more than once). | 35 | | `--context=` | Load WordPress in a given context. | 36 | | `--[no-]color` | Whether to colorize the output. | 37 | | `--debug[=]` | Show all PHP errors and add verbosity to WP-CLI output. Built-in groups include: bootstrap, commandfactory, and help. | 38 | | `--prompt[=]` | Prompt the user to enter values for all command arguments, or a subset specified as comma-separated values. | 39 | | `--quiet` | Suppress informational messages. | 40 | -------------------------------------------------------------------------------- /commands/option.md: -------------------------------------------------------------------------------- 1 | # wp option 2 | 3 | Retrieves and sets site options, including plugin and WordPress settings. 4 | 5 | See the [Plugin Settings API](https://developer.wordpress.org/plugins/settings/settings-api/) and the [Theme Options](https://developer.wordpress.org/themes/customize-api/) for more information on adding customized options. 6 | 7 | ### EXAMPLES 8 | 9 | # Get site URL. 10 | $ wp option get siteurl 11 | http://example.com 12 | 13 | # Add option. 14 | $ wp option add my_option foobar 15 | Success: Added 'my_option' option. 16 | 17 | # Update option. 18 | $ wp option update my_option '{"foo": "bar"}' --format=json 19 | Success: Updated 'my_option' option. 20 | 21 | # Delete option. 22 | $ wp option delete my_option 23 | Success: Deleted 'my_option' option. 24 | 25 | 26 | -------------------------------------------------------------------------------- /commands/option/get-autoload.md: -------------------------------------------------------------------------------- 1 | # wp option get-autoload 2 | 3 | Gets the 'autoload' value for an option. 4 | 5 | ### OPTIONS 6 | 7 | <key> 8 | : The name of the option to get 'autoload' of. 9 | 10 | ### EXAMPLES 11 | 12 | # Get the 'autoload' value for an option. 13 | $ wp option get-autoload blogname 14 | yes 15 | 16 | ### GLOBAL PARAMETERS 17 | 18 | These [global parameters](https://make.wordpress.org/cli/handbook/config/) have the same behavior across all commands and affect how WP-CLI interacts with WordPress. 19 | 20 | | **Argument** | **Description** | 21 | |:----------------|:-----------------------------| 22 | | `--path=` | Path to the WordPress files. | 23 | | `--url=` | Pretend request came from given URL. In multisite, this argument is how the target site is specified. | 24 | | `--ssh=[:][@][:][]` | Perform operation against a remote server over SSH (or a container using scheme of "docker", "docker-compose", "docker-compose-run", "vagrant"). | 25 | | `--http=` | Perform operation against a remote WordPress installation over HTTP. | 26 | | `--user=` | Set the WordPress user. | 27 | | `--skip-plugins[=]` | Skip loading all plugins, or a comma-separated list of plugins. Note: mu-plugins are still loaded. | 28 | | `--skip-themes[=]` | Skip loading all themes, or a comma-separated list of themes. | 29 | | `--skip-packages` | Skip loading all installed packages. | 30 | | `--require=` | Load PHP file before running the command (may be used more than once). | 31 | | `--exec=` | Execute PHP code before running the command (may be used more than once). | 32 | | `--context=` | Load WordPress in a given context. | 33 | | `--[no-]color` | Whether to colorize the output. | 34 | | `--debug[=]` | Show all PHP errors and add verbosity to WP-CLI output. Built-in groups include: bootstrap, commandfactory, and help. | 35 | | `--prompt[=]` | Prompt the user to enter values for all command arguments, or a subset specified as comma-separated values. | 36 | | `--quiet` | Suppress informational messages. | 37 | -------------------------------------------------------------------------------- /commands/package.md: -------------------------------------------------------------------------------- 1 | # wp package 2 | 3 | Lists, installs, and removes WP-CLI packages. 4 | 5 | Unless overridden, these commands run on the `before_wp_load` hook, just before the WP load process begins. 6 | 7 | WP-CLI packages are community-maintained projects built on WP-CLI. They can contain WP-CLI commands, but they can also just extend WP-CLI in some way. 8 | 9 | Learn how to create your own command from the 10 | [Commands Cookbook](https://make.wordpress.org/cli/handbook/guides/commands-cookbook/) 11 | 12 | ### EXAMPLES 13 | 14 | # List installed packages. 15 | $ wp package list 16 | +-----------------------+------------------+----------+-----------+----------------+ 17 | | name | authors | version | update | update_version | 18 | +-----------------------+------------------+----------+-----------+----------------+ 19 | | wp-cli/server-command | Daniel Bachhuber | dev-main | available | 2.x-dev | 20 | +-----------------------+------------------+----------+-----------+----------------+ 21 | 22 | # Install the latest development version of the package. 23 | $ wp package install wp-cli/server-command 24 | Installing package wp-cli/server-command (dev-main) 25 | Updating /home/person/.wp-cli/packages/composer.json to require the package... 26 | Using Composer to install the package... 27 | --- 28 | Loading composer repositories with package information 29 | Updating dependencies 30 | Resolving dependencies through SAT 31 | Dependency resolution completed in 0.005 seconds 32 | Analyzed 732 packages to resolve dependencies 33 | Analyzed 1034 rules to resolve dependencies 34 | - Installing package 35 | Writing lock file 36 | Generating autoload files 37 | --- 38 | Success: Package installed. 39 | 40 | # Uninstall package. 41 | $ wp package uninstall wp-cli/server-command 42 | Removing require statement for package 'wp-cli/server-command' from /home/person/.wp-cli/packages/composer.json 43 | Removing repository details from /home/person/.wp-cli/packages/composer.json 44 | Removing package directories and regenerating autoloader... 45 | Success: Uninstalled package. 46 | 47 | 48 | -------------------------------------------------------------------------------- /commands/plugin.md: -------------------------------------------------------------------------------- 1 | # wp plugin 2 | 3 | Manages plugins, including installs, activations, and updates. 4 | 5 | See the WordPress [Plugin Handbook](https://developer.wordpress.org/plugins/) developer resource for more information on plugins. 6 | 7 | ### EXAMPLES 8 | 9 | # Activate plugin 10 | $ wp plugin activate hello 11 | Plugin 'hello' activated. 12 | Success: Activated 1 of 1 plugins. 13 | 14 | # Deactivate plugin 15 | $ wp plugin deactivate hello 16 | Plugin 'hello' deactivated. 17 | Success: Deactivated 1 of 1 plugins. 18 | 19 | # Delete plugin 20 | $ wp plugin delete hello 21 | Deleted 'hello' plugin. 22 | Success: Deleted 1 of 1 plugins. 23 | 24 | # Install the latest version from wordpress.org and activate 25 | $ wp plugin install bbpress --activate 26 | Installing bbPress (2.5.9) 27 | Downloading install package from https://downloads.wordpress.org/plugin/bbpress.2.5.9.zip... 28 | Using cached file '/home/vagrant/.wp-cli/cache/plugin/bbpress-2.5.9.zip'... 29 | Unpacking the package... 30 | Installing the plugin... 31 | Plugin installed successfully. 32 | Activating 'bbpress'... 33 | Plugin 'bbpress' activated. 34 | Success: Installed 1 of 1 plugins. 35 | 36 | 37 | -------------------------------------------------------------------------------- /commands/plugin/auto-updates.md: -------------------------------------------------------------------------------- 1 | # wp plugin auto-updates 2 | 3 | Manages plugin auto-updates. 4 | 5 | ### EXAMPLES 6 | 7 | # Enable the auto-updates for a plugin 8 | $ wp plugin auto-updates enable hello 9 | Plugin auto-updates for 'hello' enabled. 10 | Success: Enabled 1 of 1 plugin auto-updates. 11 | 12 | # Disable the auto-updates for a plugin 13 | $ wp plugin auto-updates disable hello 14 | Plugin auto-updates for 'hello' disabled. 15 | Success: Disabled 1 of 1 plugin auto-updates. 16 | 17 | # Get the status of plugin auto-updates 18 | $ wp plugin auto-updates status hello 19 | Auto-updates for plugin 'hello' are disabled. 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /commands/post-type.md: -------------------------------------------------------------------------------- 1 | # wp post-type 2 | 3 | Retrieves details on the site's registered post types. 4 | 5 | Get information on WordPress' built-in and the site's [custom post types](https://developer.wordpress.org/plugins/post-types/). 6 | 7 | ### EXAMPLES 8 | 9 | # Get details about a post type 10 | $ wp post-type get page --fields=name,label,hierarchical --format=json 11 | {"name":"page","label":"Pages","hierarchical":true} 12 | 13 | # List post types with 'post' capability type 14 | $ wp post-type list --capability_type=post --fields=name,public 15 | +---------------+--------+ 16 | | name | public | 17 | +---------------+--------+ 18 | | post | 1 | 19 | | attachment | 1 | 20 | | revision | | 21 | | nav_menu_item | | 22 | +---------------+--------+ 23 | 24 | 25 | -------------------------------------------------------------------------------- /commands/post.md: -------------------------------------------------------------------------------- 1 | # wp post 2 | 3 | Manages posts, content, and meta. 4 | 5 | ### EXAMPLES 6 | 7 | # Create a new post. 8 | $ wp post create --post_type=post --post_title='A sample post' 9 | Success: Created post 123. 10 | 11 | # Update an existing post. 12 | $ wp post update 123 --post_status=draft 13 | Success: Updated post 123. 14 | 15 | # Delete an existing post. 16 | $ wp post delete 123 17 | Success: Trashed post 123. 18 | 19 | 20 | -------------------------------------------------------------------------------- /commands/post/edit.md: -------------------------------------------------------------------------------- 1 | # wp post edit 2 | 3 | Launches system editor to edit post content. 4 | 5 | ### OPTIONS 6 | 7 | <id> 8 | : The ID of the post to edit. 9 | 10 | ### EXAMPLES 11 | 12 | # Launch system editor to edit post 13 | $ wp post edit 123 14 | 15 | ### GLOBAL PARAMETERS 16 | 17 | These [global parameters](https://make.wordpress.org/cli/handbook/config/) have the same behavior across all commands and affect how WP-CLI interacts with WordPress. 18 | 19 | | **Argument** | **Description** | 20 | |:----------------|:-----------------------------| 21 | | `--path=` | Path to the WordPress files. | 22 | | `--url=` | Pretend request came from given URL. In multisite, this argument is how the target site is specified. | 23 | | `--ssh=[:][@][:][]` | Perform operation against a remote server over SSH (or a container using scheme of "docker", "docker-compose", "docker-compose-run", "vagrant"). | 24 | | `--http=` | Perform operation against a remote WordPress installation over HTTP. | 25 | | `--user=` | Set the WordPress user. | 26 | | `--skip-plugins[=]` | Skip loading all plugins, or a comma-separated list of plugins. Note: mu-plugins are still loaded. | 27 | | `--skip-themes[=]` | Skip loading all themes, or a comma-separated list of themes. | 28 | | `--skip-packages` | Skip loading all installed packages. | 29 | | `--require=` | Load PHP file before running the command (may be used more than once). | 30 | | `--exec=` | Execute PHP code before running the command (may be used more than once). | 31 | | `--context=` | Load WordPress in a given context. | 32 | | `--[no-]color` | Whether to colorize the output. | 33 | | `--debug[=]` | Show all PHP errors and add verbosity to WP-CLI output. Built-in groups include: bootstrap, commandfactory, and help. | 34 | | `--prompt[=]` | Prompt the user to enter values for all command arguments, or a subset specified as comma-separated values. | 35 | | `--quiet` | Suppress informational messages. | 36 | -------------------------------------------------------------------------------- /commands/post/meta.md: -------------------------------------------------------------------------------- 1 | # wp post meta 2 | 3 | Adds, updates, deletes, and lists post custom fields. 4 | 5 | ### EXAMPLES 6 | 7 | # Set post meta 8 | $ wp post meta set 123 _wp_page_template about.php 9 | Success: Updated custom field '_wp_page_template'. 10 | 11 | # Get post meta 12 | $ wp post meta get 123 _wp_page_template 13 | about.php 14 | 15 | # Update post meta 16 | $ wp post meta update 123 _wp_page_template contact.php 17 | Success: Updated custom field '_wp_page_template'. 18 | 19 | # Delete post meta 20 | $ wp post meta delete 123 _wp_page_template 21 | Success: Deleted custom field. 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /commands/post/meta/delete.md: -------------------------------------------------------------------------------- 1 | # wp post meta delete 2 | 3 | Delete a meta field. 4 | 5 | ### OPTIONS 6 | 7 | <id> 8 | : The ID of the object. 9 | 10 | [<key>] 11 | : The name of the meta field to delete. 12 | 13 | [<value>] 14 | : The value to delete. If omitted, all rows with key will deleted. 15 | 16 | [\--all] 17 | : Delete all meta for the object. 18 | 19 | ### GLOBAL PARAMETERS 20 | 21 | These [global parameters](https://make.wordpress.org/cli/handbook/config/) have the same behavior across all commands and affect how WP-CLI interacts with WordPress. 22 | 23 | | **Argument** | **Description** | 24 | |:----------------|:-----------------------------| 25 | | `--path=` | Path to the WordPress files. | 26 | | `--url=` | Pretend request came from given URL. In multisite, this argument is how the target site is specified. | 27 | | `--ssh=[:][@][:][]` | Perform operation against a remote server over SSH (or a container using scheme of "docker", "docker-compose", "docker-compose-run", "vagrant"). | 28 | | `--http=` | Perform operation against a remote WordPress installation over HTTP. | 29 | | `--user=` | Set the WordPress user. | 30 | | `--skip-plugins[=]` | Skip loading all plugins, or a comma-separated list of plugins. Note: mu-plugins are still loaded. | 31 | | `--skip-themes[=]` | Skip loading all themes, or a comma-separated list of themes. | 32 | | `--skip-packages` | Skip loading all installed packages. | 33 | | `--require=` | Load PHP file before running the command (may be used more than once). | 34 | | `--exec=` | Execute PHP code before running the command (may be used more than once). | 35 | | `--context=` | Load WordPress in a given context. | 36 | | `--[no-]color` | Whether to colorize the output. | 37 | | `--debug[=]` | Show all PHP errors and add verbosity to WP-CLI output. Built-in groups include: bootstrap, commandfactory, and help. | 38 | | `--prompt[=]` | Prompt the user to enter values for all command arguments, or a subset specified as comma-separated values. | 39 | | `--quiet` | Suppress informational messages. | 40 | -------------------------------------------------------------------------------- /commands/post/term.md: -------------------------------------------------------------------------------- 1 | # wp post term 2 | 3 | Adds, updates, removes, and lists post terms. 4 | 5 | ### EXAMPLES 6 | 7 | # Set category post term `test` to the post ID 123 8 | $ wp post term set 123 test category 9 | Success: Set term. 10 | 11 | # Set category post terms `test` and `apple` to the post ID 123 12 | $ wp post term set 123 test apple category 13 | Success: Set terms. 14 | 15 | # List category post terms for the post ID 123 16 | $ wp post term list 123 category --fields=term_id,slug 17 | +---------+-------+ 18 | | term_id | slug | 19 | +---------+-------+ 20 | | 2 | apple | 21 | | 3 | test | 22 | +----------+------+ 23 | 24 | # Remove category post terms `test` and `apple` for the post ID 123 25 | $ wp post term remove 123 category test apple 26 | Success: Removed terms. 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /commands/post/url-to-id.md: -------------------------------------------------------------------------------- 1 | # wp post url-to-id 2 | 3 | Gets the post ID for a given URL. 4 | 5 | ### OPTIONS 6 | 7 | <url> 8 | : The URL of the post to get. 9 | 10 | ### EXAMPLES 11 | 12 | # Get post ID by URL 13 | $ wp post url-to-id https://example.com/?p=1 14 | 1 15 | 16 | ### GLOBAL PARAMETERS 17 | 18 | These [global parameters](https://make.wordpress.org/cli/handbook/config/) have the same behavior across all commands and affect how WP-CLI interacts with WordPress. 19 | 20 | | **Argument** | **Description** | 21 | |:----------------|:-----------------------------| 22 | | `--path=` | Path to the WordPress files. | 23 | | `--url=` | Pretend request came from given URL. In multisite, this argument is how the target site is specified. | 24 | | `--ssh=[:][@][:][]` | Perform operation against a remote server over SSH (or a container using scheme of "docker", "docker-compose", "docker-compose-run", "vagrant"). | 25 | | `--http=` | Perform operation against a remote WordPress installation over HTTP. | 26 | | `--user=` | Set the WordPress user. | 27 | | `--skip-plugins[=]` | Skip loading all plugins, or a comma-separated list of plugins. Note: mu-plugins are still loaded. | 28 | | `--skip-themes[=]` | Skip loading all themes, or a comma-separated list of themes. | 29 | | `--skip-packages` | Skip loading all installed packages. | 30 | | `--require=` | Load PHP file before running the command (may be used more than once). | 31 | | `--exec=` | Execute PHP code before running the command (may be used more than once). | 32 | | `--context=` | Load WordPress in a given context. | 33 | | `--[no-]color` | Whether to colorize the output. | 34 | | `--debug[=]` | Show all PHP errors and add verbosity to WP-CLI output. Built-in groups include: bootstrap, commandfactory, and help. | 35 | | `--prompt[=]` | Prompt the user to enter values for all command arguments, or a subset specified as comma-separated values. | 36 | | `--quiet` | Suppress informational messages. | 37 | -------------------------------------------------------------------------------- /commands/profile.md: -------------------------------------------------------------------------------- 1 | # wp profile 2 | 3 | Quickly identify what's slow with WordPress. 4 | 5 | ### EXAMPLES 6 | 7 | # See an overview for each stage of the load process. 8 | $ wp profile stage --fields=stage,time,cache_ratio 9 | +------------+---------+-------------+ 10 | | stage | time | cache_ratio | 11 | +------------+---------+-------------+ 12 | | bootstrap | 0.7994s | 93.21% | 13 | | main_query | 0.0123s | 94.29% | 14 | | template | 0.792s | 91.23% | 15 | +------------+---------+-------------+ 16 | | total (3) | 1.6037s | 92.91% | 17 | +------------+---------+-------------+ 18 | 19 | # Dive into hook performance for a given stage. 20 | $ wp profile stage bootstrap --fields=hook,time,cache_ratio --spotlight 21 | +--------------------------+---------+-------------+ 22 | | hook | time | cache_ratio | 23 | +--------------------------+---------+-------------+ 24 | | muplugins_loaded:before | 0.1767s | 33.33% | 25 | | plugins_loaded:before | 0.103s | 78.13% | 26 | | plugins_loaded | 0.0194s | 19.32% | 27 | | setup_theme | 0.0018s | 75% | 28 | | after_setup_theme:before | 0.0116s | 95.45% | 29 | | after_setup_theme | 0.0049s | 96% | 30 | | init | 0.1428s | 76.74% | 31 | | wp_loaded:after | 0.0236s | | 32 | +--------------------------+---------+-------------+ 33 | | total (8) | 0.4837s | 67.71% | 34 | +--------------------------+---------+-------------+ 35 | 36 | 37 | -------------------------------------------------------------------------------- /commands/rewrite.md: -------------------------------------------------------------------------------- 1 | # wp rewrite 2 | 3 | Lists or flushes the site's rewrite rules, updates the permalink structure. 4 | 5 | See the WordPress [Rewrite API](https://codex.wordpress.org/Rewrite_API) and 6 | [WP Rewrite](https://codex.wordpress.org/Class_Reference/WP_Rewrite) class reference. 7 | 8 | ### EXAMPLES 9 | 10 | # Flush rewrite rules 11 | $ wp rewrite flush 12 | Success: Rewrite rules flushed. 13 | 14 | # Update permalink structure 15 | $ wp rewrite structure '/%year%/%monthnum%/%postname%' 16 | Success: Rewrite structure set. 17 | 18 | # List rewrite rules 19 | $ wp rewrite list --format=csv 20 | match,query,source 21 | ^wp-json/?$,index.php?rest_route=/,other 22 | ^wp-json/(.*)?,index.php?rest_route=/$matches[1],other 23 | category/(.+?)/feed/(feed|rdf|rss|rss2|atom)/?$,index.php?category_name=$matches[1]&feed=$matches[2],category 24 | category/(.+?)/(feed|rdf|rss|rss2|atom)/?$,index.php?category_name=$matches[1]&feed=$matches[2],category 25 | category/(.+?)/embed/?$,index.php?category_name=$matches[1]&embed=true,category 26 | 27 | 28 | -------------------------------------------------------------------------------- /commands/role.md: -------------------------------------------------------------------------------- 1 | # wp role 2 | 3 | Manages user roles, including creating new roles and resetting to defaults. 4 | 5 | See references for [Roles and Capabilities](https://codex.wordpress.org/Roles_and_Capabilities) and [WP User class](https://codex.wordpress.org/Class_Reference/WP_User). 6 | 7 | ### EXAMPLES 8 | 9 | # List roles. 10 | $ wp role list --fields=role --format=csv 11 | role 12 | administrator 13 | editor 14 | author 15 | contributor 16 | subscriber 17 | 18 | # Check to see if a role exists. 19 | $ wp role exists editor 20 | Success: Role with ID 'editor' exists. 21 | 22 | # Create a new role. 23 | $ wp role create approver Approver 24 | Success: Role with key 'approver' created. 25 | 26 | # Delete an existing role. 27 | $ wp role delete approver 28 | Success: Role with key 'approver' deleted. 29 | 30 | # Reset existing roles to their default capabilities. 31 | $ wp role reset administrator author contributor 32 | Success: Reset 3/3 roles. 33 | 34 | 35 | -------------------------------------------------------------------------------- /commands/role/exists.md: -------------------------------------------------------------------------------- 1 | # wp role exists 2 | 3 | Checks if a role exists. 4 | 5 | Exits with return code 0 if the role exists, 1 if it does not. 6 | 7 | ### OPTIONS 8 | 9 | <role-key> 10 | : The internal name of the role. 11 | 12 | ### EXAMPLES 13 | 14 | # Check if a role exists. 15 | $ wp role exists editor 16 | Success: Role with ID 'editor' exists. 17 | 18 | ### GLOBAL PARAMETERS 19 | 20 | These [global parameters](https://make.wordpress.org/cli/handbook/config/) have the same behavior across all commands and affect how WP-CLI interacts with WordPress. 21 | 22 | | **Argument** | **Description** | 23 | |:----------------|:-----------------------------| 24 | | `--path=` | Path to the WordPress files. | 25 | | `--url=` | Pretend request came from given URL. In multisite, this argument is how the target site is specified. | 26 | | `--ssh=[:][@][:][]` | Perform operation against a remote server over SSH (or a container using scheme of "docker", "docker-compose", "docker-compose-run", "vagrant"). | 27 | | `--http=` | Perform operation against a remote WordPress installation over HTTP. | 28 | | `--user=` | Set the WordPress user. | 29 | | `--skip-plugins[=]` | Skip loading all plugins, or a comma-separated list of plugins. Note: mu-plugins are still loaded. | 30 | | `--skip-themes[=]` | Skip loading all themes, or a comma-separated list of themes. | 31 | | `--skip-packages` | Skip loading all installed packages. | 32 | | `--require=` | Load PHP file before running the command (may be used more than once). | 33 | | `--exec=` | Execute PHP code before running the command (may be used more than once). | 34 | | `--context=` | Load WordPress in a given context. | 35 | | `--[no-]color` | Whether to colorize the output. | 36 | | `--debug[=]` | Show all PHP errors and add verbosity to WP-CLI output. Built-in groups include: bootstrap, commandfactory, and help. | 37 | | `--prompt[=]` | Prompt the user to enter values for all command arguments, or a subset specified as comma-separated values. | 38 | | `--quiet` | Suppress informational messages. | 39 | -------------------------------------------------------------------------------- /commands/scaffold.md: -------------------------------------------------------------------------------- 1 | # wp scaffold 2 | 3 | Generates code for post types, taxonomies, plugins, child themes, etc. 4 | 5 | ### EXAMPLES 6 | 7 | # Generate a new plugin with unit tests. 8 | $ wp scaffold plugin sample-plugin 9 | Success: Created plugin files. 10 | Success: Created test files. 11 | 12 | # Generate theme based on _s. 13 | $ wp scaffold _s sample-theme --theme_name="Sample Theme" --author="John Doe" 14 | Success: Created theme 'Sample Theme'. 15 | 16 | # Generate code for post type registration in given theme. 17 | $ wp scaffold post-type movie --label=Movie --theme=simple-life 18 | Success: Created '/var/www/example.com/public_html/wp-content/themes/simple-life/post-types/movie.php'. 19 | 20 | 21 | -------------------------------------------------------------------------------- /commands/sidebar.md: -------------------------------------------------------------------------------- 1 | # wp sidebar 2 | 3 | Lists registered sidebars. 4 | 5 | A [sidebar](https://developer.wordpress.org/themes/functionality/sidebars/) is any widgetized area of your theme. 6 | 7 | ### EXAMPLES 8 | 9 | # List sidebars 10 | $ wp sidebar list --fields=name,id --format=csv 11 | name,id 12 | "Widget Area",sidebar-1 13 | "Inactive Widgets",wp_inactive_widgets 14 | 15 | 16 | -------------------------------------------------------------------------------- /commands/site.md: -------------------------------------------------------------------------------- 1 | # wp site 2 | 3 | Creates, deletes, empties, moderates, and lists one or more sites on a multisite installation. 4 | 5 | ### EXAMPLES 6 | 7 | # Create site 8 | $ wp site create --slug=example 9 | Success: Site 3 created: www.example.com/example/ 10 | 11 | # Output a simple list of site URLs 12 | $ wp site list --field=url 13 | http://www.example.com/ 14 | http://www.example.com/subdir/ 15 | 16 | # Delete site 17 | $ wp site delete 123 18 | Are you sure you want to delete the 'http://www.example.com/example' site? [y/n] y 19 | Success: The site at 'http://www.example.com/example' was deleted. 20 | 21 | 22 | -------------------------------------------------------------------------------- /commands/site/meta.md: -------------------------------------------------------------------------------- 1 | # wp site meta 2 | 3 | Adds, updates, deletes, and lists site custom fields. 4 | 5 | ### EXAMPLES 6 | 7 | # Set site meta 8 | $ wp site meta set 123 bio "Mary is a WordPress developer." 9 | Success: Updated custom field 'bio'. 10 | 11 | # Get site meta 12 | $ wp site meta get 123 bio 13 | Mary is a WordPress developer. 14 | 15 | # Update site meta 16 | $ wp site meta update 123 bio "Mary is an awesome WordPress developer." 17 | Success: Updated custom field 'bio'. 18 | 19 | # Delete site meta 20 | $ wp site meta delete 123 bio 21 | Success: Deleted custom field. 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /commands/site/meta/delete.md: -------------------------------------------------------------------------------- 1 | # wp site meta delete 2 | 3 | Delete a meta field. 4 | 5 | ### OPTIONS 6 | 7 | <id> 8 | : The ID of the object. 9 | 10 | [<key>] 11 | : The name of the meta field to delete. 12 | 13 | [<value>] 14 | : The value to delete. If omitted, all rows with key will deleted. 15 | 16 | [\--all] 17 | : Delete all meta for the object. 18 | 19 | ### GLOBAL PARAMETERS 20 | 21 | These [global parameters](https://make.wordpress.org/cli/handbook/config/) have the same behavior across all commands and affect how WP-CLI interacts with WordPress. 22 | 23 | | **Argument** | **Description** | 24 | |:----------------|:-----------------------------| 25 | | `--path=` | Path to the WordPress files. | 26 | | `--url=` | Pretend request came from given URL. In multisite, this argument is how the target site is specified. | 27 | | `--ssh=[:][@][:][]` | Perform operation against a remote server over SSH (or a container using scheme of "docker", "docker-compose", "docker-compose-run", "vagrant"). | 28 | | `--http=` | Perform operation against a remote WordPress installation over HTTP. | 29 | | `--user=` | Set the WordPress user. | 30 | | `--skip-plugins[=]` | Skip loading all plugins, or a comma-separated list of plugins. Note: mu-plugins are still loaded. | 31 | | `--skip-themes[=]` | Skip loading all themes, or a comma-separated list of themes. | 32 | | `--skip-packages` | Skip loading all installed packages. | 33 | | `--require=` | Load PHP file before running the command (may be used more than once). | 34 | | `--exec=` | Execute PHP code before running the command (may be used more than once). | 35 | | `--context=` | Load WordPress in a given context. | 36 | | `--[no-]color` | Whether to colorize the output. | 37 | | `--debug[=]` | Show all PHP errors and add verbosity to WP-CLI output. Built-in groups include: bootstrap, commandfactory, and help. | 38 | | `--prompt[=]` | Prompt the user to enter values for all command arguments, or a subset specified as comma-separated values. | 39 | | `--quiet` | Suppress informational messages. | 40 | -------------------------------------------------------------------------------- /commands/site/option.md: -------------------------------------------------------------------------------- 1 | # wp site option 2 | 3 | Adds, updates, deletes, and lists site options in a multisite installation. 4 | 5 | ### EXAMPLES 6 | 7 | # Get site registration 8 | $ wp site option get registration 9 | none 10 | 11 | # Add site option 12 | $ wp site option add my_option foobar 13 | Success: Added 'my_option' site option. 14 | 15 | # Update site option 16 | $ wp site option update my_option '{"foo": "bar"}' --format=json 17 | Success: Updated 'my_option' site option. 18 | 19 | # Delete site option 20 | $ wp site option delete my_option 21 | Success: Deleted 'my_option' site option. 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /commands/site/option/delete.md: -------------------------------------------------------------------------------- 1 | # wp site option delete 2 | 3 | Deletes a site option. 4 | 5 | ### OPTIONS 6 | 7 | <key> 8 | : Key for the site option. 9 | 10 | ### EXAMPLES 11 | 12 | $ wp site option delete my_option 13 | Success: Deleted 'my_option' site option. 14 | 15 | ### GLOBAL PARAMETERS 16 | 17 | These [global parameters](https://make.wordpress.org/cli/handbook/config/) have the same behavior across all commands and affect how WP-CLI interacts with WordPress. 18 | 19 | | **Argument** | **Description** | 20 | |:----------------|:-----------------------------| 21 | | `--path=` | Path to the WordPress files. | 22 | | `--url=` | Pretend request came from given URL. In multisite, this argument is how the target site is specified. | 23 | | `--ssh=[:][@][:][]` | Perform operation against a remote server over SSH (or a container using scheme of "docker", "docker-compose", "docker-compose-run", "vagrant"). | 24 | | `--http=` | Perform operation against a remote WordPress installation over HTTP. | 25 | | `--user=` | Set the WordPress user. | 26 | | `--skip-plugins[=]` | Skip loading all plugins, or a comma-separated list of plugins. Note: mu-plugins are still loaded. | 27 | | `--skip-themes[=]` | Skip loading all themes, or a comma-separated list of themes. | 28 | | `--skip-packages` | Skip loading all installed packages. | 29 | | `--require=` | Load PHP file before running the command (may be used more than once). | 30 | | `--exec=` | Execute PHP code before running the command (may be used more than once). | 31 | | `--context=` | Load WordPress in a given context. | 32 | | `--[no-]color` | Whether to colorize the output. | 33 | | `--debug[=]` | Show all PHP errors and add verbosity to WP-CLI output. Built-in groups include: bootstrap, commandfactory, and help. | 34 | | `--prompt[=]` | Prompt the user to enter values for all command arguments, or a subset specified as comma-separated values. | 35 | | `--quiet` | Suppress informational messages. | 36 | -------------------------------------------------------------------------------- /commands/site/switch-language.md: -------------------------------------------------------------------------------- 1 | # wp site switch-language 2 | 3 | Activates a given language. 4 | 5 | ### OPTIONS 6 | 7 | <language> 8 | : Language code to activate. 9 | 10 | ### EXAMPLES 11 | 12 | $ wp site switch-language ja 13 | Success: Language activated. 14 | 15 | ### GLOBAL PARAMETERS 16 | 17 | These [global parameters](https://make.wordpress.org/cli/handbook/config/) have the same behavior across all commands and affect how WP-CLI interacts with WordPress. 18 | 19 | | **Argument** | **Description** | 20 | |:----------------|:-----------------------------| 21 | | `--path=` | Path to the WordPress files. | 22 | | `--url=` | Pretend request came from given URL. In multisite, this argument is how the target site is specified. | 23 | | `--ssh=[:][@][:][]` | Perform operation against a remote server over SSH (or a container using scheme of "docker", "docker-compose", "docker-compose-run", "vagrant"). | 24 | | `--http=` | Perform operation against a remote WordPress installation over HTTP. | 25 | | `--user=` | Set the WordPress user. | 26 | | `--skip-plugins[=]` | Skip loading all plugins, or a comma-separated list of plugins. Note: mu-plugins are still loaded. | 27 | | `--skip-themes[=]` | Skip loading all themes, or a comma-separated list of themes. | 28 | | `--skip-packages` | Skip loading all installed packages. | 29 | | `--require=` | Load PHP file before running the command (may be used more than once). | 30 | | `--exec=` | Execute PHP code before running the command (may be used more than once). | 31 | | `--context=` | Load WordPress in a given context. | 32 | | `--[no-]color` | Whether to colorize the output. | 33 | | `--debug[=]` | Show all PHP errors and add verbosity to WP-CLI output. Built-in groups include: bootstrap, commandfactory, and help. | 34 | | `--prompt[=]` | Prompt the user to enter values for all command arguments, or a subset specified as comma-separated values. | 35 | | `--quiet` | Suppress informational messages. | 36 | -------------------------------------------------------------------------------- /commands/super-admin.md: -------------------------------------------------------------------------------- 1 | # wp super-admin 2 | 3 | Lists, adds, or removes super admin users on a multisite installation. 4 | 5 | ### EXAMPLES 6 | 7 | # List user with super-admin capabilities. 8 | $ wp super-admin list 9 | supervisor 10 | administrator 11 | 12 | # Grant super-admin privileges to the user. 13 | $ wp super-admin add superadmin2 14 | Success: Granted super-admin capabilities to 1 user. 15 | 16 | # Revoke super-admin privileges from the user. 17 | $ wp super-admin remove superadmin2 18 | Success: Revoked super-admin capabilities from 1 user. 19 | 20 | 21 | -------------------------------------------------------------------------------- /commands/super-admin/add.md: -------------------------------------------------------------------------------- 1 | # wp super-admin add 2 | 3 | Grants super admin privileges to one or more users. 4 | 5 | ### OPTIONS 6 | 7 | <user>... 8 | : One or more user IDs, user emails, or user logins. 9 | 10 | ### EXAMPLES 11 | 12 | # Grant super-admin privileges to the user. 13 | $ wp super-admin add superadmin2 14 | Success: Granted super-admin capabilities to 1 user. 15 | 16 | ### GLOBAL PARAMETERS 17 | 18 | These [global parameters](https://make.wordpress.org/cli/handbook/config/) have the same behavior across all commands and affect how WP-CLI interacts with WordPress. 19 | 20 | | **Argument** | **Description** | 21 | |:----------------|:-----------------------------| 22 | | `--path=` | Path to the WordPress files. | 23 | | `--url=` | Pretend request came from given URL. In multisite, this argument is how the target site is specified. | 24 | | `--ssh=[:][@][:][]` | Perform operation against a remote server over SSH (or a container using scheme of "docker", "docker-compose", "docker-compose-run", "vagrant"). | 25 | | `--http=` | Perform operation against a remote WordPress installation over HTTP. | 26 | | `--user=` | Set the WordPress user. | 27 | | `--skip-plugins[=]` | Skip loading all plugins, or a comma-separated list of plugins. Note: mu-plugins are still loaded. | 28 | | `--skip-themes[=]` | Skip loading all themes, or a comma-separated list of themes. | 29 | | `--skip-packages` | Skip loading all installed packages. | 30 | | `--require=` | Load PHP file before running the command (may be used more than once). | 31 | | `--exec=` | Execute PHP code before running the command (may be used more than once). | 32 | | `--context=` | Load WordPress in a given context. | 33 | | `--[no-]color` | Whether to colorize the output. | 34 | | `--debug[=]` | Show all PHP errors and add verbosity to WP-CLI output. Built-in groups include: bootstrap, commandfactory, and help. | 35 | | `--prompt[=]` | Prompt the user to enter values for all command arguments, or a subset specified as comma-separated values. | 36 | | `--quiet` | Suppress informational messages. | 37 | -------------------------------------------------------------------------------- /commands/taxonomy.md: -------------------------------------------------------------------------------- 1 | # wp taxonomy 2 | 3 | Retrieves information about registered taxonomies. 4 | 5 | See references for [built-in taxonomies](https://developer.wordpress.org/themes/basics/categories-tags-custom-taxonomies/) and [custom taxonomies](https://developer.wordpress.org/plugins/taxonomies/working-with-custom-taxonomies/). 6 | 7 | ### EXAMPLES 8 | 9 | # List all taxonomies with 'post' object type. 10 | $ wp taxonomy list --object_type=post --fields=name,public 11 | +-------------+--------+ 12 | | name | public | 13 | +-------------+--------+ 14 | | category | 1 | 15 | | post_tag | 1 | 16 | | post_format | 1 | 17 | +-------------+--------+ 18 | 19 | # Get capabilities of 'post_tag' taxonomy. 20 | $ wp taxonomy get post_tag --field=cap 21 | {"manage_terms":"manage_categories","edit_terms":"manage_categories","delete_terms":"manage_categories","assign_terms":"edit_posts"} 22 | 23 | 24 | -------------------------------------------------------------------------------- /commands/term.md: -------------------------------------------------------------------------------- 1 | # wp term 2 | 3 | Manages taxonomy terms and term meta, with create, delete, and list commands. 4 | 5 | See reference for [taxonomies and their terms](https://codex.wordpress.org/Taxonomies). 6 | 7 | ### EXAMPLES 8 | 9 | # Create a new term. 10 | $ wp term create category Apple --description="A type of fruit" 11 | Success: Created category 199. 12 | 13 | # Get details about a term. 14 | $ wp term get category 199 --format=json --fields=term_id,name,slug,count 15 | {"term_id":199,"name":"Apple","slug":"apple","count":1} 16 | 17 | # Update an existing term. 18 | $ wp term update category 15 --name=Apple 19 | Success: Term updated. 20 | 21 | # Get the term's URL. 22 | $ wp term list post_tag --include=123 --field=url 23 | http://example.com/tag/tips-and-tricks 24 | 25 | # Delete post category 26 | $ wp term delete category 15 27 | Success: Deleted category 15. 28 | 29 | # Recount posts assigned to each categories and tags 30 | $ wp term recount category post_tag 31 | Success: Updated category term count 32 | Success: Updated post_tag term count 33 | 34 | 35 | -------------------------------------------------------------------------------- /commands/term/meta.md: -------------------------------------------------------------------------------- 1 | # wp term meta 2 | 3 | Adds, updates, deletes, and lists term custom fields. 4 | 5 | ### EXAMPLES 6 | 7 | # Set term meta 8 | $ wp term meta set 123 bio "Mary is a WordPress developer." 9 | Success: Updated custom field 'bio'. 10 | 11 | # Get term meta 12 | $ wp term meta get 123 bio 13 | Mary is a WordPress developer. 14 | 15 | # Update term meta 16 | $ wp term meta update 123 bio "Mary is an awesome WordPress developer." 17 | Success: Updated custom field 'bio'. 18 | 19 | # Delete term meta 20 | $ wp term meta delete 123 bio 21 | Success: Deleted custom field. 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /commands/term/meta/delete.md: -------------------------------------------------------------------------------- 1 | # wp term meta delete 2 | 3 | Delete a meta field. 4 | 5 | ### OPTIONS 6 | 7 | <id> 8 | : The ID of the object. 9 | 10 | [<key>] 11 | : The name of the meta field to delete. 12 | 13 | [<value>] 14 | : The value to delete. If omitted, all rows with key will deleted. 15 | 16 | [\--all] 17 | : Delete all meta for the object. 18 | 19 | ### GLOBAL PARAMETERS 20 | 21 | These [global parameters](https://make.wordpress.org/cli/handbook/config/) have the same behavior across all commands and affect how WP-CLI interacts with WordPress. 22 | 23 | | **Argument** | **Description** | 24 | |:----------------|:-----------------------------| 25 | | `--path=` | Path to the WordPress files. | 26 | | `--url=` | Pretend request came from given URL. In multisite, this argument is how the target site is specified. | 27 | | `--ssh=[:][@][:][]` | Perform operation against a remote server over SSH (or a container using scheme of "docker", "docker-compose", "docker-compose-run", "vagrant"). | 28 | | `--http=` | Perform operation against a remote WordPress installation over HTTP. | 29 | | `--user=` | Set the WordPress user. | 30 | | `--skip-plugins[=]` | Skip loading all plugins, or a comma-separated list of plugins. Note: mu-plugins are still loaded. | 31 | | `--skip-themes[=]` | Skip loading all themes, or a comma-separated list of themes. | 32 | | `--skip-packages` | Skip loading all installed packages. | 33 | | `--require=` | Load PHP file before running the command (may be used more than once). | 34 | | `--exec=` | Execute PHP code before running the command (may be used more than once). | 35 | | `--context=` | Load WordPress in a given context. | 36 | | `--[no-]color` | Whether to colorize the output. | 37 | | `--debug[=]` | Show all PHP errors and add verbosity to WP-CLI output. Built-in groups include: bootstrap, commandfactory, and help. | 38 | | `--prompt[=]` | Prompt the user to enter values for all command arguments, or a subset specified as comma-separated values. | 39 | | `--quiet` | Suppress informational messages. | 40 | -------------------------------------------------------------------------------- /commands/theme.md: -------------------------------------------------------------------------------- 1 | # wp theme 2 | 3 | Manages themes, including installs, activations, and updates. 4 | 5 | See the WordPress [Theme Handbook](https://developer.wordpress.org/themes/) developer resource for more information on themes. 6 | 7 | ### EXAMPLES 8 | 9 | # Install the latest version of a theme from wordpress.org and activate 10 | $ wp theme install twentysixteen --activate 11 | Installing Twenty Sixteen (1.2) 12 | Downloading install package from http://downloads.wordpress.org/theme/twentysixteen.1.2.zip... 13 | Unpacking the package... 14 | Installing the theme... 15 | Theme installed successfully. 16 | Activating 'twentysixteen'... 17 | Success: Switched to 'Twenty Sixteen' theme. 18 | Success: Installed 1 of 1 themes. 19 | 20 | # Get details of an installed theme 21 | $ wp theme get twentysixteen --fields=name,title,version 22 | +---------+----------------+ 23 | | Field | Value | 24 | +---------+----------------+ 25 | | name | Twenty Sixteen | 26 | | title | Twenty Sixteen | 27 | | version | 1.2 | 28 | +---------+----------------+ 29 | 30 | # Get status of theme 31 | $ wp theme status twentysixteen 32 | Theme twentysixteen details: 33 | Name: Twenty Sixteen 34 | Status: Active 35 | Version: 1.2 36 | Author: the WordPress team 37 | 38 | 39 | -------------------------------------------------------------------------------- /commands/theme/activate.md: -------------------------------------------------------------------------------- 1 | # wp theme activate 2 | 3 | Activates a theme. 4 | 5 | ### OPTIONS 6 | 7 | <theme> 8 | : The theme to activate. 9 | 10 | ### EXAMPLES 11 | 12 | $ wp theme activate twentysixteen 13 | Success: Switched to 'Twenty Sixteen' theme. 14 | 15 | ### GLOBAL PARAMETERS 16 | 17 | These [global parameters](https://make.wordpress.org/cli/handbook/config/) have the same behavior across all commands and affect how WP-CLI interacts with WordPress. 18 | 19 | | **Argument** | **Description** | 20 | |:----------------|:-----------------------------| 21 | | `--path=` | Path to the WordPress files. | 22 | | `--url=` | Pretend request came from given URL. In multisite, this argument is how the target site is specified. | 23 | | `--ssh=[:][@][:][]` | Perform operation against a remote server over SSH (or a container using scheme of "docker", "docker-compose", "docker-compose-run", "vagrant"). | 24 | | `--http=` | Perform operation against a remote WordPress installation over HTTP. | 25 | | `--user=` | Set the WordPress user. | 26 | | `--skip-plugins[=]` | Skip loading all plugins, or a comma-separated list of plugins. Note: mu-plugins are still loaded. | 27 | | `--skip-themes[=]` | Skip loading all themes, or a comma-separated list of themes. | 28 | | `--skip-packages` | Skip loading all installed packages. | 29 | | `--require=` | Load PHP file before running the command (may be used more than once). | 30 | | `--exec=` | Execute PHP code before running the command (may be used more than once). | 31 | | `--context=` | Load WordPress in a given context. | 32 | | `--[no-]color` | Whether to colorize the output. | 33 | | `--debug[=]` | Show all PHP errors and add verbosity to WP-CLI output. Built-in groups include: bootstrap, commandfactory, and help. | 34 | | `--prompt[=]` | Prompt the user to enter values for all command arguments, or a subset specified as comma-separated values. | 35 | | `--quiet` | Suppress informational messages. | 36 | -------------------------------------------------------------------------------- /commands/theme/auto-updates.md: -------------------------------------------------------------------------------- 1 | # wp theme auto-updates 2 | 3 | Manages theme auto-updates. 4 | 5 | ### EXAMPLES 6 | 7 | # Enable the auto-updates for a theme 8 | $ wp theme auto-updates enable twentysixteen 9 | Theme auto-updates for 'twentysixteen' enabled. 10 | Success: Enabled 1 of 1 theme auto-updates. 11 | 12 | # Disable the auto-updates for a theme 13 | $ wp theme auto-updates disable twentysixteen 14 | Theme auto-updates for 'twentysixteen' disabled. 15 | Success: Disabled 1 of 1 theme auto-updates. 16 | 17 | # Get the status of theme auto-updates 18 | $ wp theme auto-updates status twentysixteen 19 | Auto-updates for theme 'twentysixteen' are disabled. 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /commands/theme/is-active.md: -------------------------------------------------------------------------------- 1 | # wp theme is-active 2 | 3 | Checks if a given theme is active. 4 | 5 | Returns exit code 0 when active, 1 when not active. 6 | 7 | ### OPTIONS 8 | 9 | <theme> 10 | : The plugin to check. 11 | 12 | ### EXAMPLES 13 | 14 | # Check whether theme is Active; exit status 0 if active, otherwise 1 15 | $ wp theme is-active twentyfifteen 16 | $ echo $? 17 | 1 18 | 19 | ### GLOBAL PARAMETERS 20 | 21 | These [global parameters](https://make.wordpress.org/cli/handbook/config/) have the same behavior across all commands and affect how WP-CLI interacts with WordPress. 22 | 23 | | **Argument** | **Description** | 24 | |:----------------|:-----------------------------| 25 | | `--path=` | Path to the WordPress files. | 26 | | `--url=` | Pretend request came from given URL. In multisite, this argument is how the target site is specified. | 27 | | `--ssh=[:][@][:][]` | Perform operation against a remote server over SSH (or a container using scheme of "docker", "docker-compose", "docker-compose-run", "vagrant"). | 28 | | `--http=` | Perform operation against a remote WordPress installation over HTTP. | 29 | | `--user=` | Set the WordPress user. | 30 | | `--skip-plugins[=]` | Skip loading all plugins, or a comma-separated list of plugins. Note: mu-plugins are still loaded. | 31 | | `--skip-themes[=]` | Skip loading all themes, or a comma-separated list of themes. | 32 | | `--skip-packages` | Skip loading all installed packages. | 33 | | `--require=` | Load PHP file before running the command (may be used more than once). | 34 | | `--exec=` | Execute PHP code before running the command (may be used more than once). | 35 | | `--context=` | Load WordPress in a given context. | 36 | | `--[no-]color` | Whether to colorize the output. | 37 | | `--debug[=]` | Show all PHP errors and add verbosity to WP-CLI output. Built-in groups include: bootstrap, commandfactory, and help. | 38 | | `--prompt[=]` | Prompt the user to enter values for all command arguments, or a subset specified as comma-separated values. | 39 | | `--quiet` | Suppress informational messages. | 40 | -------------------------------------------------------------------------------- /commands/theme/mod.md: -------------------------------------------------------------------------------- 1 | # wp theme mod 2 | 3 | Sets, gets, and removes theme mods. 4 | 5 | ### EXAMPLES 6 | 7 | # Set the 'background_color' theme mod to '000000'. 8 | $ wp theme mod set background_color 000000 9 | Success: Theme mod background_color set to 000000. 10 | 11 | # Get single theme mod in JSON format. 12 | $ wp theme mod get background_color --format=json 13 | [{"key":"background_color","value":"dd3333"}] 14 | 15 | # Remove all theme mods. 16 | $ wp theme mod remove --all 17 | Success: Theme mods removed. 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /commands/theme/mod/set.md: -------------------------------------------------------------------------------- 1 | # wp theme mod set 2 | 3 | Sets the value of a theme mod. 4 | 5 | ### OPTIONS 6 | 7 | <mod> 8 | : The name of the theme mod to set or update. 9 | 10 | <value> 11 | : The new value. 12 | 13 | ### EXAMPLES 14 | 15 | # Set theme mod 16 | $ wp theme mod set background_color 000000 17 | Success: Theme mod background_color set to 000000. 18 | 19 | ### GLOBAL PARAMETERS 20 | 21 | These [global parameters](https://make.wordpress.org/cli/handbook/config/) have the same behavior across all commands and affect how WP-CLI interacts with WordPress. 22 | 23 | | **Argument** | **Description** | 24 | |:----------------|:-----------------------------| 25 | | `--path=` | Path to the WordPress files. | 26 | | `--url=` | Pretend request came from given URL. In multisite, this argument is how the target site is specified. | 27 | | `--ssh=[:][@][:][]` | Perform operation against a remote server over SSH (or a container using scheme of "docker", "docker-compose", "docker-compose-run", "vagrant"). | 28 | | `--http=` | Perform operation against a remote WordPress installation over HTTP. | 29 | | `--user=` | Set the WordPress user. | 30 | | `--skip-plugins[=]` | Skip loading all plugins, or a comma-separated list of plugins. Note: mu-plugins are still loaded. | 31 | | `--skip-themes[=]` | Skip loading all themes, or a comma-separated list of themes. | 32 | | `--skip-packages` | Skip loading all installed packages. | 33 | | `--require=` | Load PHP file before running the command (may be used more than once). | 34 | | `--exec=` | Execute PHP code before running the command (may be used more than once). | 35 | | `--context=` | Load WordPress in a given context. | 36 | | `--[no-]color` | Whether to colorize the output. | 37 | | `--debug[=]` | Show all PHP errors and add verbosity to WP-CLI output. Built-in groups include: bootstrap, commandfactory, and help. | 38 | | `--prompt[=]` | Prompt the user to enter values for all command arguments, or a subset specified as comma-separated values. | 39 | | `--quiet` | Suppress informational messages. | 40 | -------------------------------------------------------------------------------- /commands/transient.md: -------------------------------------------------------------------------------- 1 | # wp transient 2 | 3 | Adds, gets, and deletes entries in the WordPress Transient Cache. 4 | 5 | By default, the transient cache uses the WordPress database to persist values between requests. On a single site installation, values are stored in the `wp_options` table. On a multisite installation, values are stored in the `wp_options` or the `wp_sitemeta` table, depending on use of the `--network` flag. 6 | 7 | When a persistent object cache drop-in is installed (e.g. Redis or Memcached), the transient cache skips the database and simply wraps the WP Object Cache. 8 | 9 | ### EXAMPLES 10 | 11 | # Set transient. 12 | $ wp transient set sample_key "test data" 3600 13 | Success: Transient added. 14 | 15 | # Get transient. 16 | $ wp transient get sample_key 17 | test data 18 | 19 | # Delete transient. 20 | $ wp transient delete sample_key 21 | Success: Transient deleted. 22 | 23 | # Delete expired transients. 24 | $ wp transient delete --expired 25 | Success: 12 expired transients deleted from the database. 26 | 27 | # Delete all transients. 28 | $ wp transient delete --all 29 | Success: 14 transients deleted from the database. 30 | 31 | 32 | -------------------------------------------------------------------------------- /commands/user.md: -------------------------------------------------------------------------------- 1 | # wp user 2 | 3 | Manages users, along with their roles, capabilities, and meta. 4 | 5 | See references for [Roles and Capabilities](https://codex.wordpress.org/Roles_and_Capabilities) and [WP User class](https://codex.wordpress.org/Class_Reference/WP_User). 6 | 7 | ### EXAMPLES 8 | 9 | # List user IDs 10 | $ wp user list --field=ID 11 | 1 12 | 13 | # Create a new user. 14 | $ wp user create bob bob@example.com --role=author 15 | Success: Created user 3. 16 | Password: k9**&I4vNH(& 17 | 18 | # Update an existing user. 19 | $ wp user update 123 --display_name=Mary --user_pass=marypass 20 | Success: Updated user 123. 21 | 22 | # Delete user 123 and reassign posts to user 567 23 | $ wp user delete 123 --reassign=567 24 | Success: Removed user 123 from http://example.com. 25 | 26 | 27 | -------------------------------------------------------------------------------- /commands/user/application-password.md: -------------------------------------------------------------------------------- 1 | # wp user application-password 2 | 3 | Creates, updates, deletes, lists and retrieves application passwords. 4 | 5 | ### EXAMPLES 6 | 7 | # List user application passwords and only show app name and password hash 8 | $ wp user application-password list 123 --fields=name,password 9 | +--------+------------------------------------+ 10 | | name | password | 11 | +--------+------------------------------------+ 12 | | myapp | $P$BVGeou1CUot114YohIemgpwxQCzb8O/ | 13 | +--------+------------------------------------+ 14 | 15 | # Get a specific application password and only show app name and created timestamp 16 | $ wp user application-password get 123 6633824d-c1d7-4f79-9dd5-4586f734d69e --fields=name,created 17 | +--------+------------+ 18 | | name | created | 19 | +--------+------------+ 20 | | myapp | 1638395611 | 21 | +--------+------------+ 22 | 23 | # Create user application password 24 | $ wp user application-password create 123 myapp 25 | Success: Created application password. 26 | Password: ZG1bxdxdzjTwhsY8vK8l1C65 27 | 28 | # Only print the password without any chrome 29 | $ wp user application-password create 123 myapp --porcelain 30 | ZG1bxdxdzjTwhsY8vK8l1C65 31 | 32 | # Update an existing application password 33 | $ wp user application-password update 123 6633824d-c1d7-4f79-9dd5-4586f734d69e --name=newappname 34 | Success: Updated application password. 35 | 36 | # Delete an existing application password 37 | $ wp user application-password delete 123 6633824d-c1d7-4f79-9dd5-4586f734d69e 38 | Success: Deleted 1 of 1 application password. 39 | 40 | # Check if an application password for a given application exists 41 | $ wp user application-password exists 123 myapp 42 | $ echo $? 43 | 1 44 | 45 | # Bash script for checking whether an application password exists and creating one if not 46 | if ! wp user application-password exists 123 myapp; then 47 | PASSWORD=$(wp user application-password create 123 myapp --porcelain) 48 | fi 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /commands/user/meta.md: -------------------------------------------------------------------------------- 1 | # wp user meta 2 | 3 | Adds, updates, deletes, and lists user custom fields. 4 | 5 | ### EXAMPLES 6 | 7 | # Add user meta 8 | $ wp user meta add 123 bio "Mary is an WordPress developer." 9 | Success: Added custom field. 10 | 11 | # List user meta 12 | $ wp user meta list 123 --keys=nickname,description,wp_capabilities 13 | +---------+-----------------+--------------------------------+ 14 | | user_id | meta_key | meta_value | 15 | +---------+-----------------+--------------------------------+ 16 | | 123 | nickname | supervisor | 17 | | 123 | description | Mary is a WordPress developer. | 18 | | 123 | wp_capabilities | {"administrator":true} | 19 | +---------+-----------------+--------------------------------+ 20 | 21 | # Update user meta 22 | $ wp user meta update 123 bio "Mary is an awesome WordPress developer." 23 | Success: Updated custom field 'bio'. 24 | 25 | # Delete user meta 26 | $ wp user meta delete 123 bio 27 | Success: Deleted custom field. 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /commands/user/session.md: -------------------------------------------------------------------------------- 1 | # wp user session 2 | 3 | Destroys and lists a user's sessions. 4 | 5 | ### EXAMPLES 6 | 7 | # List a user's sessions. 8 | $ wp user session list admin@example.com --format=csv 9 | login_time,expiration_time,ip,ua 10 | "2016-01-01 12:34:56","2016-02-01 12:34:56",127.0.0.1,"Mozilla/5.0..." 11 | 12 | # Destroy the most recent session of the given user. 13 | $ wp user session destroy admin 14 | Success: Destroyed session. 3 sessions remaining. 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /commands/user/set-role.md: -------------------------------------------------------------------------------- 1 | # wp user set-role 2 | 3 | Sets the user role. 4 | 5 | ### OPTIONS 6 | 7 | <user> 8 | : User ID, user email, or user login. 9 | 10 | [<role>] 11 | : Make the user have the specified role. If not passed, the default role is used. 12 | 13 | ### EXAMPLES 14 | 15 | $ wp user set-role 12 author 16 | Success: Added johndoe (12) to http://example.com as author. 17 | 18 | ### GLOBAL PARAMETERS 19 | 20 | These [global parameters](https://make.wordpress.org/cli/handbook/config/) have the same behavior across all commands and affect how WP-CLI interacts with WordPress. 21 | 22 | | **Argument** | **Description** | 23 | |:----------------|:-----------------------------| 24 | | `--path=` | Path to the WordPress files. | 25 | | `--url=` | Pretend request came from given URL. In multisite, this argument is how the target site is specified. | 26 | | `--ssh=[:][@][:][]` | Perform operation against a remote server over SSH (or a container using scheme of "docker", "docker-compose", "docker-compose-run", "vagrant"). | 27 | | `--http=` | Perform operation against a remote WordPress installation over HTTP. | 28 | | `--user=` | Set the WordPress user. | 29 | | `--skip-plugins[=]` | Skip loading all plugins, or a comma-separated list of plugins. Note: mu-plugins are still loaded. | 30 | | `--skip-themes[=]` | Skip loading all themes, or a comma-separated list of themes. | 31 | | `--skip-packages` | Skip loading all installed packages. | 32 | | `--require=` | Load PHP file before running the command (may be used more than once). | 33 | | `--exec=` | Execute PHP code before running the command (may be used more than once). | 34 | | `--context=` | Load WordPress in a given context. | 35 | | `--[no-]color` | Whether to colorize the output. | 36 | | `--debug[=]` | Show all PHP errors and add verbosity to WP-CLI output. Built-in groups include: bootstrap, commandfactory, and help. | 37 | | `--prompt[=]` | Prompt the user to enter values for all command arguments, or a subset specified as comma-separated values. | 38 | | `--quiet` | Suppress informational messages. | 39 | -------------------------------------------------------------------------------- /commands/user/signup.md: -------------------------------------------------------------------------------- 1 | # wp user signup 2 | 3 | Manages signups on a multisite installation. 4 | 5 | ### EXAMPLES 6 | 7 | # List signups. 8 | $ wp user signup list 9 | +-----------+------------+---------------------+---------------------+--------+------------------+ 10 | | signup_id | user_login | user_email | registered | active | activation_key | 11 | +-----------+------------+---------------------+---------------------+--------+------------------+ 12 | | 1 | bobuser | bobuser@example.com | 2024-03-13 05:46:53 | 1 | 7320b2f009266618 | 13 | | 2 | johndoe | johndoe@example.com | 2024-03-13 06:24:44 | 0 | 9068d859186cd0b5 | 14 | +-----------+------------+---------------------+---------------------+--------+------------------+ 15 | 16 | # Activate signup. 17 | $ wp user signup activate 2 18 | Signup 2 activated. Password: bZFSGsfzb9xs 19 | Success: Activated 1 of 1 signups. 20 | 21 | # Delete signup. 22 | $ wp user signup delete 3 23 | Signup 3 deleted. 24 | Success: Deleted 1 of 1 signups. 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /commands/user/spam.md: -------------------------------------------------------------------------------- 1 | # wp user spam 2 | 3 | Marks one or more users as spam on multisite. 4 | 5 | ### OPTIONS 6 | 7 | <user>... 8 | : The user login, user email, or user ID of the user(s) to mark as spam. 9 | 10 | ### EXAMPLES 11 | 12 | # Mark user as spam. 13 | $ wp user spam 123 14 | User 123 marked as spam. 15 | Success: Spammed 1 of 1 users. 16 | 17 | ### GLOBAL PARAMETERS 18 | 19 | These [global parameters](https://make.wordpress.org/cli/handbook/config/) have the same behavior across all commands and affect how WP-CLI interacts with WordPress. 20 | 21 | | **Argument** | **Description** | 22 | |:----------------|:-----------------------------| 23 | | `--path=` | Path to the WordPress files. | 24 | | `--url=` | Pretend request came from given URL. In multisite, this argument is how the target site is specified. | 25 | | `--ssh=[:][@][:][]` | Perform operation against a remote server over SSH (or a container using scheme of "docker", "docker-compose", "docker-compose-run", "vagrant"). | 26 | | `--http=` | Perform operation against a remote WordPress installation over HTTP. | 27 | | `--user=` | Set the WordPress user. | 28 | | `--skip-plugins[=]` | Skip loading all plugins, or a comma-separated list of plugins. Note: mu-plugins are still loaded. | 29 | | `--skip-themes[=]` | Skip loading all themes, or a comma-separated list of themes. | 30 | | `--skip-packages` | Skip loading all installed packages. | 31 | | `--require=` | Load PHP file before running the command (may be used more than once). | 32 | | `--exec=` | Execute PHP code before running the command (may be used more than once). | 33 | | `--context=` | Load WordPress in a given context. | 34 | | `--[no-]color` | Whether to colorize the output. | 35 | | `--debug[=]` | Show all PHP errors and add verbosity to WP-CLI output. Built-in groups include: bootstrap, commandfactory, and help. | 36 | | `--prompt[=]` | Prompt the user to enter values for all command arguments, or a subset specified as comma-separated values. | 37 | | `--quiet` | Suppress informational messages. | 38 | -------------------------------------------------------------------------------- /commands/user/term.md: -------------------------------------------------------------------------------- 1 | # wp user term 2 | 3 | Adds, updates, removes, and lists user terms. 4 | 5 | ### EXAMPLES 6 | 7 | # Set user terms 8 | $ wp user term set 123 test category 9 | Success: Set terms. 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /commands/user/unspam.md: -------------------------------------------------------------------------------- 1 | # wp user unspam 2 | 3 | Removes one or more users from spam on multisite. 4 | 5 | ### OPTIONS 6 | 7 | <user>... 8 | : The user login, user email, or user ID of the user(s) to remove from spam. 9 | 10 | ### EXAMPLES 11 | 12 | # Remove user from spam. 13 | $ wp user unspam 123 14 | User 123 removed from spam. 15 | Success: Unspamed 1 of 1 users. 16 | 17 | ### GLOBAL PARAMETERS 18 | 19 | These [global parameters](https://make.wordpress.org/cli/handbook/config/) have the same behavior across all commands and affect how WP-CLI interacts with WordPress. 20 | 21 | | **Argument** | **Description** | 22 | |:----------------|:-----------------------------| 23 | | `--path=` | Path to the WordPress files. | 24 | | `--url=` | Pretend request came from given URL. In multisite, this argument is how the target site is specified. | 25 | | `--ssh=[:][@][:][]` | Perform operation against a remote server over SSH (or a container using scheme of "docker", "docker-compose", "docker-compose-run", "vagrant"). | 26 | | `--http=` | Perform operation against a remote WordPress installation over HTTP. | 27 | | `--user=` | Set the WordPress user. | 28 | | `--skip-plugins[=]` | Skip loading all plugins, or a comma-separated list of plugins. Note: mu-plugins are still loaded. | 29 | | `--skip-themes[=]` | Skip loading all themes, or a comma-separated list of themes. | 30 | | `--skip-packages` | Skip loading all installed packages. | 31 | | `--require=` | Load PHP file before running the command (may be used more than once). | 32 | | `--exec=` | Execute PHP code before running the command (may be used more than once). | 33 | | `--context=` | Load WordPress in a given context. | 34 | | `--[no-]color` | Whether to colorize the output. | 35 | | `--debug[=]` | Show all PHP errors and add verbosity to WP-CLI output. Built-in groups include: bootstrap, commandfactory, and help. | 36 | | `--prompt[=]` | Prompt the user to enter values for all command arguments, or a subset specified as comma-separated values. | 37 | | `--quiet` | Suppress informational messages. | 38 | -------------------------------------------------------------------------------- /commands/widget.md: -------------------------------------------------------------------------------- 1 | # wp widget 2 | 3 | Manages widgets, including adding and moving them within sidebars. 4 | 5 | A [widget](https://developer.wordpress.org/themes/functionality/widgets/) adds content and features to a widget area (also called a [sidebar](https://developer.wordpress.org/themes/functionality/sidebars/)). 6 | 7 | ### EXAMPLES 8 | 9 | # List widgets on a given sidebar 10 | $ wp widget list sidebar-1 11 | +----------+------------+----------+----------------------+ 12 | | name | id | position | options | 13 | +----------+------------+----------+----------------------+ 14 | | meta | meta-6 | 1 | {"title":"Meta"} | 15 | | calendar | calendar-2 | 2 | {"title":"Calendar"} | 16 | +----------+------------+----------+----------------------+ 17 | 18 | # Add a calendar widget to the second position on the sidebar 19 | $ wp widget add calendar sidebar-1 2 20 | Success: Added widget to sidebar. 21 | 22 | # Update option(s) associated with a given widget 23 | $ wp widget update calendar-1 --title="Calendar" 24 | Success: Widget updated. 25 | 26 | # Delete one or more widgets entirely 27 | $ wp widget delete calendar-2 archive-1 28 | Success: 2 widgets removed from sidebar. 29 | 30 | 31 | -------------------------------------------------------------------------------- /commands/widget/delete.md: -------------------------------------------------------------------------------- 1 | # wp widget delete 2 | 3 | Deletes one or more widgets from a sidebar. 4 | 5 | ### OPTIONS 6 | 7 | <widget-id>... 8 | : Unique ID for the widget(s) 9 | 10 | ### EXAMPLES 11 | 12 | # Delete the recent-comments-2 widget from its sidebar. 13 | $ wp widget delete recent-comments-2 14 | Success: Deleted 1 of 1 widgets. 15 | 16 | ### GLOBAL PARAMETERS 17 | 18 | These [global parameters](https://make.wordpress.org/cli/handbook/config/) have the same behavior across all commands and affect how WP-CLI interacts with WordPress. 19 | 20 | | **Argument** | **Description** | 21 | |:----------------|:-----------------------------| 22 | | `--path=` | Path to the WordPress files. | 23 | | `--url=` | Pretend request came from given URL. In multisite, this argument is how the target site is specified. | 24 | | `--ssh=[:][@][:][]` | Perform operation against a remote server over SSH (or a container using scheme of "docker", "docker-compose", "docker-compose-run", "vagrant"). | 25 | | `--http=` | Perform operation against a remote WordPress installation over HTTP. | 26 | | `--user=` | Set the WordPress user. | 27 | | `--skip-plugins[=]` | Skip loading all plugins, or a comma-separated list of plugins. Note: mu-plugins are still loaded. | 28 | | `--skip-themes[=]` | Skip loading all themes, or a comma-separated list of themes. | 29 | | `--skip-packages` | Skip loading all installed packages. | 30 | | `--require=` | Load PHP file before running the command (may be used more than once). | 31 | | `--exec=` | Execute PHP code before running the command (may be used more than once). | 32 | | `--context=` | Load WordPress in a given context. | 33 | | `--[no-]color` | Whether to colorize the output. | 34 | | `--debug[=]` | Show all PHP errors and add verbosity to WP-CLI output. Built-in groups include: bootstrap, commandfactory, and help. | 35 | | `--prompt[=]` | Prompt the user to enter values for all command arguments, or a subset specified as comma-separated values. | 36 | | `--quiet` | Suppress informational messages. | 37 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "wp-cli/handbook", 3 | "description": "Source files for the handbook that is generated for make.wordpress.org.", 4 | "config": { 5 | "allow-plugins": { 6 | "dealerdirect/phpcodesniffer-composer-installer": true 7 | }, 8 | "sort-packages": true 9 | }, 10 | "autoload": { 11 | "files": [ 12 | "bin/command.php" 13 | ] 14 | }, 15 | "require-dev": { 16 | "wp-cli/wp-cli": "^2.11", 17 | "wp-cli/wp-cli-tests": "^4.3.14" 18 | }, 19 | "minimum-stability": "dev", 20 | "prefer-stable": true, 21 | "scripts": { 22 | "behat": "run-behat-tests", 23 | "behat-rerun": "rerun-behat-tests", 24 | "lint": "run-linter-tests", 25 | "phpcs": "run-phpcs-tests", 26 | "phpcbf": "run-phpcbf-cleanup", 27 | "phpunit": "run-php-unit-tests", 28 | "prepare-tests": "install-package-tests", 29 | "test": [ 30 | "@lint", 31 | "@phpcs", 32 | "@phpunit", 33 | "@behat" 34 | ] 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /doctor-check-constant-value.md: -------------------------------------------------------------------------------- 1 | # Write a check for asserting the value of a given constant 2 | 3 | One of the check types included in `wp doctor` is `Constant_Definition`, or the ability to assert that a given constant is either defined, a specific value, or falsy. The check type is in use by a couple of the [default diagnostic checks](https://make.wordpress.org/cli/handbook/guides/doctor/doctor-default-checks/), and you can use the `Constant_Definition` check type in your [custom `doctor.yml` configuration file](https://make.wordpress.org/cli/handbook/guides/doctor/doctor-customize-config/). As an example, here are two checks using `Constant_Definition`, one which ensures `SAVEQUERIES` isn't defined and the other which ensures `DISALLOW_FILE_MODS` is true: 4 | 5 | constant-savequeries-falsy: 6 | check: Constant_Definition 7 | options: 8 | constant: SAVEQUERIES 9 | falsy: true 10 | constant-disallow-file-mods-true: 11 | check: Constant_Definition 12 | options: 13 | constant: DISALLOW_FILE_MODS 14 | value: true 15 | 16 | 17 | Run together, you might see: 18 | 19 | $ wp doctor check --config=constant-definition.yml --all 20 | +----------------------------------+---------+--------------------------------------------------+ 21 | | name | status | message | 22 | +----------------------------------+---------+--------------------------------------------------+ 23 | | constant-savequeries-falsy | success | Constant 'SAVEQUERIES' is undefined. | 24 | | constant-disallow-file-mods-true | success | Constant 'DISALLOW_FILE_MODS' is defined 'true'. | 25 | +----------------------------------+---------+--------------------------------------------------+ 26 | 27 | 28 | The `Constant_Definition` check type accepts the following options: 29 | 30 | * 'constant': Name of the constant. 31 | * 'defined': Constant is expected to be defined. 32 | * 'value': Constant is expected to be a specific value. 33 | * 'falsy': Constant is expected to be undefined or falsy. 34 | -------------------------------------------------------------------------------- /doctor-check-option-value.md: -------------------------------------------------------------------------------- 1 | # Write a check for asserting the value of a given option 2 | 3 | One of the check types included in `wp doctor` is `Option_Value`, or the ability to assert that a given option is a specific value. The check type is in use by a couple of the [default diagnostic checks](https://make.wordpress.org/cli/handbook/guides/doctor/doctor-default-checks/), and you can use the `Option_Value` check type in your [custom `doctor.yml` configuration file](https://make.wordpress.org/cli/handbook/guides/doctor/doctor-customize-config/). 4 | 5 | As an example, here are two checks using `Option_Value`, one which ensures the blog is public and the other which ensures users can't register: 6 | 7 | option-blog-public: 8 | check: Option_Value 9 | options: 10 | option: blog_public 11 | value: 1 12 | option-users-can-register: 13 | check: Option_Value 14 | options: 15 | option: users_can_register 16 | value: 0 17 | 18 | 19 | Run together, you might see: 20 | 21 | $ wp doctor check --config=option-value.yml --all 22 | +---------------------------+---------+-------------------------------------------------+ 23 | | name | status | message | 24 | +---------------------------+---------+-------------------------------------------------+ 25 | | option-blog-public | error | Site is private but expected to be public. | 26 | | option-users-can-register | success | Option 'users_can_register' is '0' as expected. | 27 | +---------------------------+---------+-------------------------------------------------+ 28 | 29 | 30 | The `Option_Value` check type accepts the following options: 31 | 32 | * 'option': Name of the option. 33 | * 'value': Option is expected to be a specific value. 34 | -------------------------------------------------------------------------------- /doctor-check-plugin-status.md: -------------------------------------------------------------------------------- 1 | # Check status of a given plugin 2 | 3 | One of the check types included in `wp doctor` is `Plugin_Status`, or the ability to assert that a given plugin should be active, installed, or uninstalled. Although the check type isn't use by any of the [default diagnostic checks](https://make.wordpress.org/cli/handbook/guides/doctor/doctor-default-checks/), you can use the `Plugin_Status` check type in your [custom `doctor.yml` configuration file](https://make.wordpress.org/cli/handbook/guides/doctor/doctor-customize-config/). 4 | 5 | As an example, here are two checks using `Plugin_Status`, one which ensures Akismet is active on the system and other which ensures Hello Dolly is uninstalled: 6 | 7 | plugin-akismet-active: 8 | check: Plugin_Status 9 | options: 10 | name: akismet 11 | status: active 12 | plugin-hello-uninstalled: 13 | check: Plugin_Status 14 | options: 15 | name: hello 16 | status: uninstalled 17 | 18 | 19 | Run together, you might see: 20 | 21 | $ wp doctor check --config=plugin-status.yml --all 22 | +--------------------------+---------+----------------------------------------------------------------+ 23 | | name | status | message | 24 | +--------------------------+---------+----------------------------------------------------------------+ 25 | | plugin-akismet-active | success | Plugin 'akismet' is 'active' as expected. | 26 | | plugin-hello-uninstalled | error | Plugin 'hello' is 'inactive' but expected to be 'uninstalled'. | 27 | +--------------------------+---------+----------------------------------------------------------------+ 28 | 29 | 30 | The `Plugin_Status` check type accepts the following options: 31 | 32 | * 'name': Name of the plugin as it appears in `wp plugin list`. 33 | * 'status': Expected plugin status as one of 'active', 'installed', or 'uninstalled'. 34 | -------------------------------------------------------------------------------- /doctor.md: -------------------------------------------------------------------------------- 1 | # Doctor Guides 2 | 3 | Here are some helpful guides for using `wp doctor`: 4 | 5 | * [Default doctor diagnostic checks](https://make.wordpress.org/cli/handbook/guides/doctor/doctor-default-checks/) 6 | * [Customize doctor diagnostic checks](https://make.wordpress.org/cli/handbook/guides/doctor/doctor-customize-config/) 7 | * [Write a custom check to perform an arbitrary assertion](https://make.wordpress.org/cli/handbook/guides/doctor/doctor-write-custom-check/) 8 | * [Write a check for verifying contents of WordPress files](https://make.wordpress.org/cli/handbook/guides/doctor/doctor-check-file-contents/) 9 | * [Write a check for asserting the value of a given option](https://make.wordpress.org/cli/handbook/guides/doctor/doctor-check-option-value/) 10 | * [Write a check for asserting the value of a given constant](https://make.wordpress.org/cli/handbook/guides/doctor/doctor-check-constant-value/) 11 | * [Check status of a given plugin](https://make.wordpress.org/cli/handbook/guides/doctor/doctor-check-plugin-status/) 12 | -------------------------------------------------------------------------------- /force-output-specific-locale.md: -------------------------------------------------------------------------------- 1 | # Force output to a specific locale 2 | 3 | WP-CLI always outputs English because it doesn't support localization. But, because WordPress supports localization, you may see non-English output when performing specific commands. 4 | 5 | For instance: 6 | 7 | $ wp theme update --all 8 | מעבר למצב תחזוקה... 9 | מוריד עדכונים מ-https://downloads.wordpress.org/theme/hueman.3.3.25.zip... 10 | Using cached file '/home/xxx/.wp-cli/cache/theme/hueman-3.3.25.zip'... 11 | פתיחת עדכון... 12 | התקנת גרסה חדשה... 13 | הסרת הגרסה הקודמת של התבנית... 14 | התבנית עודכנה בהצלחה. 15 | ביטול מצב תחזוקה... 16 | +--------+-------------+-------------+---------+ 17 | | name | old_version | new_version | status | 18 | +--------+-------------+-------------+---------+ 19 | | hueman | 3.3.24 | 3.3.25 | Updated | 20 | +--------+-------------+-------------+---------+ 21 | Success: Updated 1 of 1 themes. 22 | 23 | To force WordPress to always output English at the command line, you need to filter the active locale. 24 | 25 | Given a `force-locale.php` file: 26 | 27 | ` for each active plugin to see which plugin blocks the full execution of WP-CLI. For instance, skipping the Akismet plugin would be: 10 | 11 | wp --skip-plugins=akismet 12 | 13 | Or, use `xargs` to try the entire list of active plugins: 14 | 15 | wp plugin list --field=name --status=active --skip-plugins | xargs -n1 -I % wp --skip-plugins=% plugin get % --field=name 16 | -------------------------------------------------------------------------------- /internal-api/wp-cli-add-wp-hook.md: -------------------------------------------------------------------------------- 1 | # WP_CLI::add_wp_hook() 2 | 3 | Add a callback to a WordPress action or filter. 4 | 5 | *** 6 | 7 | ## Usage 8 | 9 | WP_CLI::add_wp_hook( $tag, $function_to_add, $priority = 10, $accepted_args = 1 ) 10 | 11 |
12 | $tag (string) Named WordPress action or filter.
13 | $function_to_add (mixed) Callable to execute when the action or filter is evaluated.
14 | $priority (integer) Priority to add the callback as.
15 | $accepted_args (integer) Number of arguments to pass to callback.
16 | @return (true)
17 |
18 | 19 | 20 | *** 21 | 22 | ## Notes 23 | 24 | `add_action()` without needing access to `add_action()`. If WordPress is 25 | already loaded though, you should use `add_action()` (and `add_filter()`) 26 | instead. 27 | 28 | 29 | *Internal API documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please submit a pull request.* 30 | 31 | 32 | *** 33 | 34 | ## Related 35 | 36 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /internal-api/wp-cli-do-hook.md: -------------------------------------------------------------------------------- 1 | # WP_CLI::do_hook() 2 | 3 | Execute callbacks registered to a given hook. 4 | 5 | *** 6 | 7 | ## Usage 8 | 9 | WP_CLI::do_hook( $when, $args ) 10 | 11 |
12 | $when (string) Identifier for the hook.
13 | ...$args (mixed) Optional. Arguments that will be passed onto the
14 | @return (null|mixed) the first optional argument if optional
15 |
16 | 17 | 18 | *** 19 | 20 | ## Notes 21 | 22 | See `WP_CLI::add_hook()` for details on WP-CLI's internal hook system. 23 | Commands can provide and call their own hooks. 24 | callback provided by `WP_CLI::add_hook()`. 25 | arguments were passed, otherwise returns null. 26 | 27 | 28 | *Internal API documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please submit a pull request.* 29 | 30 | 31 | *** 32 | 33 | ## Related 34 | 35 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /internal-api/wp-cli-get-php-binary.md: -------------------------------------------------------------------------------- 1 | # WP_CLI::get_php_binary() 2 | 3 | Get the path to the PHP binary used when executing WP-CLI. 4 | 5 | *** 6 | 7 | ## Usage 8 | 9 | WP_CLI::get_php_binary() 10 | 11 |
12 | @return (string)
13 |
14 | 15 | 16 | *** 17 | 18 | ## Notes 19 | 20 | Environment values permit specific binaries to be indicated. 21 | 22 | Note: moved to Utils, left for BC. 23 | 24 | 25 | *Internal API documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please submit a pull request.* 26 | 27 | 28 | *** 29 | 30 | ## Related 31 | 32 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /internal-api/wp-cli-has-config.md: -------------------------------------------------------------------------------- 1 | # WP_CLI::has_config() 2 | 3 | Confirm that a global configuration parameter does exist. 4 | 5 | *** 6 | 7 | ## Usage 8 | 9 | WP_CLI::has_config( $key ) 10 | 11 |
12 | $key (string) Config parameter key to check.
13 | @return (bool)
14 |
15 | 16 | 17 | *Internal API documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please submit a pull request.* 18 | 19 | 20 | *** 21 | 22 | ## Related 23 | 24 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /internal-api/wp-cli-launch.md: -------------------------------------------------------------------------------- 1 | # WP_CLI::launch() 2 | 3 | Launch an arbitrary external process that takes over I/O. 4 | 5 | *** 6 | 7 | ## Usage 8 | 9 | WP_CLI::launch( $command, $exit_on_error = true, $return_detailed = false ) 10 | 11 |
12 | $command (string) External process to launch.
13 | $exit_on_error (boolean) Whether to exit if the command returns an elevated return code.
14 | $return_detailed (boolean) Whether to return an exit status (default) or detailed execution results.
15 | @return (int|ProcessRun) command exit status, or a ProcessRun object for full details.
16 |
17 | 18 | 19 | *** 20 | 21 | ## Notes 22 | 23 | ``` 24 | # `wp core download` falls back to the `tar` binary when PharData isn't available 25 | if ( ! class_exists( 'PharData' ) ) { 26 | $cmd = "tar xz --strip-components=1 --directory=%s -f $tarball"; 27 | WP_CLI::launch( Utils\esc_cmd( $cmd, $dest ) ); 28 | return; 29 | } 30 | ``` 31 | 32 | 33 | *Internal API documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please submit a pull request.* 34 | 35 | 36 | *** 37 | 38 | ## Related 39 | 40 |
    41 | 42 | 43 | 44 |
  • WP_CLI::launch_self() - Run a WP-CLI command in a new process reusing the current runtime arguments.
  • 45 | 46 | 47 |
  • WP_CLI::runcommand() - Run a WP-CLI command.
  • 48 | 49 | 50 |
  • WP_CLI::run_command() - Run a given command within the current process using the same global parameters.
  • 51 | 52 | 53 | 54 |
55 | 56 | 57 | -------------------------------------------------------------------------------- /internal-api/wp-cli-read-value.md: -------------------------------------------------------------------------------- 1 | # WP_CLI::read_value() 2 | 3 | Read a value, from various formats. 4 | 5 | *** 6 | 7 | ## Usage 8 | 9 | WP_CLI::read_value( $raw_value, $assoc_args = [] ) 10 | 11 |
12 | $raw_value (mixed)
13 | $assoc_args (array)
14 |
15 | 16 | 17 | *Internal API documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please submit a pull request.* 18 | 19 | 20 | *** 21 | 22 | ## Related 23 | 24 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /internal-api/wp-cli-run-command.md: -------------------------------------------------------------------------------- 1 | # WP_CLI::run_command() 2 | 3 | Run a given command within the current process using the same global parameters. 4 | 5 | *** 6 | 7 | ## Usage 8 | 9 | WP_CLI::run_command( $args, $assoc_args = [] ) 10 | 11 |
12 | $args (array) Positional arguments including command name.
13 | $assoc_args (array)
14 |
15 | 16 | 17 | *** 18 | 19 | ## Notes 20 | 21 | Use `WP_CLI::runcommand()` instead, which is easier to use and works better. 22 | 23 | To run a command using a new process with the same global parameters, 24 | use WP_CLI::launch_self(). To run a command using a new process with 25 | different global parameters, use WP_CLI::launch(). 26 | 27 | ``` 28 | ob_start(); 29 | WP_CLI::run_command( array( 'cli', 'cmd-dump' ) ); 30 | $ret = ob_get_clean(); 31 | ``` 32 | 33 | 34 | *Internal API documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please submit a pull request.* 35 | 36 | 37 | *** 38 | 39 | ## Related 40 | 41 |
    42 | 43 | 44 | 45 |
  • WP_CLI::launch() - Launch an arbitrary external process that takes over I/O.
  • 46 | 47 | 48 |
  • WP_CLI::launch_self() - Run a WP-CLI command in a new process reusing the current runtime arguments.
  • 49 | 50 | 51 |
  • WP_CLI::runcommand() - Run a WP-CLI command.
  • 52 | 53 | 54 | 55 |
56 | 57 | 58 | -------------------------------------------------------------------------------- /internal-api/wp-cli-utils-get-home-dir.md: -------------------------------------------------------------------------------- 1 | # WP_CLI\Utils\get_home_dir() 2 | 3 | Get the home directory. 4 | 5 | *** 6 | 7 | ## Usage 8 | 9 | WP_CLI\Utils\get_home_dir() 10 | 11 |
12 | @return (string)
13 |
14 | 15 | 16 | *Internal API documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please submit a pull request.* 17 | 18 | 19 | *** 20 | 21 | ## Related 22 | 23 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /internal-api/wp-cli-utils-get-php-binary.md: -------------------------------------------------------------------------------- 1 | # WP_CLI\Utils\get_php_binary() 2 | 3 | Get the path to the PHP binary used when executing WP-CLI. 4 | 5 | *** 6 | 7 | ## Usage 8 | 9 | WP_CLI\Utils\get_php_binary() 10 | 11 |
12 | @return (string)
13 |
14 | 15 | 16 | *** 17 | 18 | ## Notes 19 | 20 | Environment values permit specific binaries to be indicated. 21 | 22 | 23 | *Internal API documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please submit a pull request.* 24 | 25 | 26 | *** 27 | 28 | ## Related 29 | 30 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /internal-api/wp-cli-utils-get-temp-dir.md: -------------------------------------------------------------------------------- 1 | # WP_CLI\Utils\get_temp_dir() 2 | 3 | Get the system's temp directory. Warns user if it isn't writable. 4 | 5 | *** 6 | 7 | ## Usage 8 | 9 | WP_CLI\Utils\get_temp_dir() 10 | 11 |
12 | @return (string)
13 |
14 | 15 | 16 | *Internal API documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please submit a pull request.* 17 | 18 | 19 | *** 20 | 21 | ## Related 22 | 23 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /internal-api/wp-cli-utils-normalize-path.md: -------------------------------------------------------------------------------- 1 | # WP_CLI\Utils\normalize_path() 2 | 3 | Normalize a filesystem path. 4 | 5 | *** 6 | 7 | ## Usage 8 | 9 | WP_CLI\Utils\normalize_path( $path ) 10 | 11 |
12 | $path (string) Path to normalize.
13 | @return (string) path.
14 |
15 | 16 | 17 | *** 18 | 19 | ## Notes 20 | 21 | On Windows systems, replaces backslashes with forward slashes 22 | and forces upper-case drive letters. 23 | Allows for two leading slashes for Windows network shares, but 24 | ensures that all other duplicate slashes are reduced to a single one. 25 | Ensures upper-case drive letters on Windows systems. 26 | 27 | 28 | *Internal API documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please submit a pull request.* 29 | 30 | 31 | *** 32 | 33 | ## Related 34 | 35 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /internal-api/wp-cli-utils-parse-str-to-argv.md: -------------------------------------------------------------------------------- 1 | # WP_CLI\Utils\parse_str_to_argv() 2 | 3 | Parse a string of command line arguments into an $argv-esqe variable. 4 | 5 | *** 6 | 7 | ## Usage 8 | 9 | WP_CLI\Utils\parse_str_to_argv( $arguments ) 10 | 11 |
12 | $arguments (string)
13 | @return (array<string>)
14 |
15 | 16 | 17 | *Internal API documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please submit a pull request.* 18 | 19 | 20 | *** 21 | 22 | ## Related 23 | 24 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /internal-api/wp-cli-utils-trailingslashit.md: -------------------------------------------------------------------------------- 1 | # WP_CLI\Utils\trailingslashit() 2 | 3 | Appends a trailing slash. 4 | 5 | *** 6 | 7 | ## Usage 8 | 9 | WP_CLI\Utils\trailingslashit( $string ) 10 | 11 |
12 | $string (string) What to add the trailing slash to.
13 | @return (string) with trailing slash added.
14 |
15 | 16 | 17 | *Internal API documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please submit a pull request.* 18 | 19 | 20 | *** 21 | 22 | ## Related 23 | 24 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /phpcs.xml.dist: -------------------------------------------------------------------------------- 1 | 2 | 3 | Custom ruleset for WP-CLI command 4 | 5 | 12 | 13 | 14 | . 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 38 | 39 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /release-checklist.md: -------------------------------------------------------------------------------- 1 | # Release Checklist 2 | 3 | There are two different release checklists available from within the [` 4 | wp-cli/wp-cli` 5 | ](https://github.com/wp-cli/wp-cli) repository: 6 | 7 | * Generate a [🚀 Regular Release Checklist](https://github.com/wp-cli/wp-cli/issues/new?assignees=schlessera&labels=i%3A+scope%3Adistribution&template=4-REGULAR_RELEASE_CHECKLIST.md&title=Release+checklist+for+v2.x.x) - applies to major (2.x.x) and minor (x.1.x) releases. 8 | * Generate a [🔧 Patch Release Checklist](https://github.com/wp-cli/wp-cli/issues/new?assignees=schlessera&labels=i%3A+scope%3Adistribution&template=5-PATCH_RELEASE_CHECKLIST.md&title=Release+checklist+for+v2.x.x) - applies to patch (x.x.1) releases only. 9 | 10 | As a first step for initiating a release process, the corresponding checklist should be generated and added to the milestone it relates to. 11 | -------------------------------------------------------------------------------- /roadmap.md: -------------------------------------------------------------------------------- 1 | # Roadmap 2 | 3 | WP-CLI is released every 3-4 months, typically around the beta period of [WordPress's release cycle](https://wordpress.org/about/roadmap/): 4 | 5 | * Current: [v2.12.0](https://github.com/wp-cli/wp-cli/releases/tag/v2.12.0) (May 7th, 2025) 6 | 7 | Patch versions are released on an as-needed basis, usually to address bugs or regressions. The current version of WP-CLI is the only officially supported version. 8 | 9 | The current longer-term goals of the project are: 10 | 11 | * Improve contributor onboarding by streamlining development environment setup, testing and documentation. 12 | * Rethink the role of WP-CLI scaffolding as an educational tool and a practical application of best practices. 13 | 14 | New features are developed as packages first. Doing so enables: 15 | 16 | * Faster feature iteration with less risk. 17 | * More contribution opportunities. 18 | * Reduced complexity and maintenance burden for the core project. 19 | 20 | To suggest new ideas, head on over to the [wp-cli/ideas](https://github.com/wp-cli/ideas) repository. 21 | 22 | For more details on how WP-CLI releases are produced, please see [Philosophy](https://make.wordpress.org/cli/handbook/philosophy/) and [Governance](https://make.wordpress.org/cli/handbook/governance/). For more information about how WP-CLI handles its requirements, please see [WP-CLI PHP Requirements Strategy](https://make.wordpress.org/cli/2019/01/15/wp-cli-php-requirements-strategy/). 23 | -------------------------------------------------------------------------------- /wp-cli.yml: -------------------------------------------------------------------------------- 1 | require: 2 | - bin/command.php 3 | --------------------------------------------------------------------------------