WPMU DEV is dedicated to supporting advanced users in every possible way. Our Hosting API Documentation is an ongoing project. Information about new commands will be added here as it becomes available.

WP-CLI is the command-line interface for WordPress. You can update plugins, configure multisite installations and much more, without using a web browser. WPMU DEV hosting has an integration module with WP CLI, which will allow you to simplify a few common tasks.

Clear Caches

Command
wp hosting clearcache [type] [URI]

Parameters

type
String
Clear any or all caches everywhere or a specific URI. Accepts: static, object, all.
URI
String
Optional specific URI to clear. Can be used only with static type.

Examples
Clears all of the Static Cache.
wp hosting clearcache static

Clears the Static Cache of the given URI.
wp hosting clearcache static /sample-page/

Clears the Static Cache of the homepage.
wp hosting clearcache static /

Clears the Object Cache.
wp hosting clearcache object

Clears both the Static Cache and the Object Cache.
wp hosting clearcache all

The following SSH commands are available to members for all WPMU DEV hosted sites.

View hosting access logs in terminal

Command
accesslog-view -[days]

Parameters

days
Integer
Optional. The number of days of logs to view. Accepts 1-7.

Examples

View logs for the current day only.
accesslog-view

View logs for the last 7 days.
accesslog-view -7

This enables you to access the access.log in a live manner, and since the logs themselves are hard to read, it’ll split up various stats.

View hosting access log details via SSH

Note that for the view command, you will need to press q to exit the shell, not ctrl+c like some linux users do.

View hosting access logs via SSH

View hosting access logs as a static file

Command
accesslog-report -[days]

Parameters

days
Integer
Optional. The number of days of logs to include in the report. Accepts 1-7.

Examples

Inlcude logs for the current day only.
accesslog-report

Include logs for the last 7 days.
accesslog-report -7

This command will create an .html file in the wp-content directory with all the same info as seen when using the view command above.

View hosting access log details as an HTML file

Note that both of these reports will be for the current day from UTC 00:00 until the time you fire the command.

Continuous integration (CI) and continuous delivery (CD) is supported by WPMU DEV to help you automate delivery of assets to your hosting droplets. Please be sure to review our Allowed & Disabled Functions & Commands document before proceeding.

Bitbucket

About

Bitbucket Pipelines fires an Docker Instance and runs the commands in this instance. So every command sequence that the user can run manually via SSH can be automated in a Pipeline. More about Pipelines here.

Setup

You will need SSH access with a Public Key without password so the Pipeline can access it programmatically. You need to create the user under the Hosting > SSH/SFTP tab of your site in your Hub. After that, add the Private/Public Key as well the Host Fingerprint to the Repository Settings in Bitbucket > Repository Settings > SSH Keys, under Pipelines.

Rsync/SSH Example

This example will run an rsync from the repository to the droplet specified in the SERVER variable using the pipe rsync-deploy. After that it will run a command to clear the server static cache.

Github

About

Github Actions fire a Linux container and runs the commands in this instance. So every command sequence that the user can run manually via SSH can be automated in an Action. More about Github actions here.

Setup

You will need SSH access with Public Key without password so the Action can access it programmatically. You need to create the user under the Hosting > SSH/SFTP tab of your site in your Hub. After that you need to add the secrets variables to Repository Settings > Secrets > Actions. We will use the following secrets:

SSH_PRIVATE_KEY: containing the private key
SSH_KNOWN_HOSTS: host fingerprint
SSH_USER: ssh username
SSH_HOST: ssh destination host

Rsync/SSG

This example will run an rsync from the repository to the droplet. After that it will run a command to clear the server static cache. This action will run on every push.