# Confirm the WordPress Site Before Running WP-CLI

https://ferkesh.net/uk/baza-znan/stattia/wp-cli-confirm-site-before-command

In a shell serving several sites, the current directory is a poor way to identify the installation. WP-CLI's path selects files. The URL selects the site context and matters on Multisite. Establish both before any operational workflow.

![Filesystem: Explicit --path; Site context: Explicit --url; Read-only proof: home + siteurl.](https://ferkesh.net/kb-media/ferkesh-guide-diagrams-batch-15.svg#wp-cli-confirm-site-before-command)

## Set an explicit path

From an authorized account, compare the document root with the hosting control panel. For a synthetic staging installation, run wp --path=/srv/staging/wordpress --url=https://example.test option get home. Substitute the actual approved path and staging hostname on your own environment.

## Verify application context

Read siteurl with the same arguments as a second check. Home and siteurl can legitimately differ if WordPress core lives in a subdirectory. A Multisite subsite needs its own URL or path, not merely the network's primary address. Record the outputs and confirm that they describe the site you intended.

## Stop on ambiguity

If the command loads the wrong site, cannot find the config, or fails because a component is unavailable, resolve the path and runtime first. Avoid adding skip flags merely to force a production write. A successful read proves that this invocation reached the expected context. It does not make an unrelated command safe.

## Related Ferkesh Knowledge Base guides

- [How to Read WordPress Site Health Before Moving Hosting](https://ferkesh.net/knowledgebase/article/wordpress-site-health-before-migration)
- [How to Map Dependencies Before Restoring a WordPress Multisite Site](https://ferkesh.net/knowledgebase/article/wordpress-multisite-restore-dependency)

## Official references

- [wp option get](https://developer.wordpress.org/cli/commands/option/get/)

Last reviewed November 27, 2026.
