Skip to content

Latest commit

 

History

History
24 lines (14 loc) · 1.28 KB

how_to_use_wpcli_tool.md

File metadata and controls

24 lines (14 loc) · 1.28 KB

How to use WP-CLI with WordPress on App Service

WP-CLI (WordPress Command Line Interface) is a command-line tool designed for managing and interacting with WordPress websites. It allows users to perform various administrative tasks, such as installing and updating plugins, managing themes, creating and managing posts, users, and databases, all through a command line interface rather than the traditional web-based dashboard.

Usage Example

WordPress on App Service comes with the wp-cli tool installed and enabled by default. It can be accessed and used from the SSH console of your App Service. To use it, please follow the below steps.

  1. Go to the scm site of your App Service using the following url: https//<appname>.scm.azurewebsites.net/

  2. Select SSH option shown on the scm site.

  3. You can now run wp-cli commands as shown in the examples below. A detailed usage of wp-cli can be found here: WP-CLI Commands

    # Display the list of plugins
    wp plugin list --path=/home/site/wwwroot --allow-root
    
    # Check for minor version upgrades
    wp core check-update --minor --path=/home/site/wwwroot --allow-root
    

Note: You need to add --allow-root at the end of your command as shown in the above examples.