> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.faaaster.io/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# Can I use WP-CLI on my Faaaster site?

**Yes.** WP-CLI is preinstalled on every Faaaster site and is used from an SSH session. Nothing to install on your side.

## Contents

- [Connect](#2-connect)
- [The most useful commands](#2-the-most-useful-commands)
- [Analyze performance](#2-analyze-performance)
- [Precautions](#2-precautions)

## Connect

1. Get your access details from the site's **Access** tab, **SSH / SFTP** section.
2. Open a session:

```bash
ssh YOUR_USERNAME@ssh.faaaster.cloud
```

3. Go to the site root:

```bash
cd www
```

4. The `wp` command is available right away:

```bash
wp --info
```

> **Go to `www` before running any command**: it's the root of your site's WordPress installation.

## The most useful commands

**Replace an address throughout the database** — the essential step after a migration:

```bash
wp search-replace 'https://old.com' 'https://new.com' --all-tables --dry-run
```

Remove `--dry-run` once you've checked the result.

**Reset an administrator password** — when you no longer have access to `/wp-admin`:

```bash
wp user list --role=administrator
wp user update USER_ID --user_pass='AStrongPassword'
```

**Deactivate the plugin that's breaking the site** — when the admin no longer responds:

```bash
wp plugin list --status=active
wp plugin deactivate plugin-name
```

**Clear temporary data** built up by plugins:

```bash
wp transient delete --all
```

**Verify core integrity**:

```bash
wp core verify-checksums
```

## Analyze performance

WP-CLI's `profile` extension is also installed on sites running PHP 7.4 or later. It shows which loading stage — and which plugin — is taking up the time:

```bash
wp profile stage --all
wp profile hook --all
```

> It's the tool to reach for when a site is slow for no obvious reason: it points to the culprit instead of leaving you to guess.

## Precautions

> ⚠️ **WP-CLI acts directly on the production site, without confirmation.** A badly targeted `search-replace` or `db` command is irreversible.

Three habits:

1. **Create a backup** from the **Backups** tab before any command that writes.
2. **Try it on a development environment** first, when possible.
3. **Use `--dry-run`** wherever the option exists.

👉 [How do I connect with SSH and SFTP?](https://help.faaaster.io/en-us/article/connect-with-ssh-and-sftp-1fijah/) · [How do I create a test environment?](https://help.faaaster.io/en-us/article/staging-environments-10kw4x4/) · [How do I back up and restore a site?](https://help.faaaster.io/en-us/article/backups-1j7rzgw/)