Title: WP_CLI\Utils\parse_ssh_url()
Published: June 12, 2025
Last modified: April 13, 2026

---

# WP_CLI\Utils\parse_ssh_url()

## In this article

 * [Usage](https://make.wordpress.org/cli/handbook/references/internal-api/wp-cli-utils-parse-ssh-url/?output_format=md#usage)
 * [Notes](https://make.wordpress.org/cli/handbook/references/internal-api/wp-cli-utils-parse-ssh-url/?output_format=md#notes)
 * [Related](https://make.wordpress.org/cli/handbook/references/internal-api/wp-cli-utils-parse-ssh-url/?output_format=md#related)

[↑ Back to top](https://make.wordpress.org/cli/handbook/references/internal-api/wp-cli-utils-parse-ssh-url/?output_format=md#wp--skip-link--target)

Parse a SSHSSH Secure SHell – a protocol for securely connecting to a remote system
in addition to or in place of a password. url for its host, port, and path.

---

## 󠀁[Usage](https://make.wordpress.org/cli/handbook/references/internal-api/wp-cli-utils-parse-ssh-url/?output_format=md#usage)󠁿

    ```
    WP_CLI\Utils\parse_ssh_url( $url, $component = -1 )
    ```

 **$url** (string) 
 **$component** (int)  **@return** (mixed)

---

## 󠀁[Notes](https://make.wordpress.org/cli/handbook/references/internal-api/wp-cli-utils-parse-ssh-url/?output_format=md#notes)󠁿

Similar to parse_url(), but adds support for defined SSH aliases.

    ```
    host OR host/path/to/wordpress OR host:port/path/to/wordpress
    ```

_Internal APIAPI An API or Application Programming Interface is a software intermediary
that allows programs to interact with each other and share data in limited, clearly
defined ways. documentation is generated from the WP-CLIWP-CLI WP-CLI is the Command
Line Interface for WordPress, used to do administrative and development tasks in
a programmatic way. The project page is [http://wp-cli.org/](http://wp-cli.org/)
[https://make.wordpress.org/cli/](https://make.wordpress.org/cli/) codebase on every
release. To suggest improvements, please submit a pull request._

---

## 󠀁[Related](https://make.wordpress.org/cli/handbook/references/internal-api/wp-cli-utils-parse-ssh-url/?output_format=md#related)󠁿

 * **[WP_CLI\Utils\write_csv()](https://make.wordpress.org/cli/handbook/internal-api/wp-cli-utils-write-csv/)**–
   Write data as CSV to a given file.
 * **[WP_CLI\Utils\http_request()](https://make.wordpress.org/cli/handbook/internal-api/wp-cli-utils-http-request/)**–
   Make a HTTPHTTP HTTP is an acronym for Hyper Text Transfer Protocol. HTTP is 
   the underlying protocol used by the World Wide Web and this protocol defines 
   how messages are formatted and transmitted, and what actions Web servers and 
   browsers should take in response to various commands. request to a remote URLURL
   A specific web address of a website or web page on the Internet, such as a website’s
   URL www.wordpress.org.
 * **[WP_CLI\Utils\get_named_sem_ver()](https://make.wordpress.org/cli/handbook/internal-api/wp-cli-utils-get-named-sem-ver/)**–
   Compare two version strings to get the named semantic version.
 * **[WP_CLI\Utils\basename()](https://make.wordpress.org/cli/handbook/internal-api/wp-cli-utils-basename/)**–
   Locale-independent version of basename()
 * **[WP_CLI\Utils\isPiped()](https://make.wordpress.org/cli/handbook/internal-api/wp-cli-utils-ispiped/)**–
   Checks whether the output of the current script is a TTY or a pipe / redirect
 * **[WP_CLI\Utils\proc_open_compat()](https://make.wordpress.org/cli/handbook/internal-api/wp-cli-utils-proc-open-compat/)**–
   Windows compatible `proc_open()`. Works around bug in PHPPHP PHP (recursive acronym
   for PHP: Hypertext Preprocessor) is a widely-used open source general-purpose
   scripting language that is especially suited for web development and can be embedded
   into HTML. [https://www.php.net/manual/en/preface.php](https://www.php.net/manual/en/preface.php),
   and also deals with *nix-like `ENV_VAR=blah cmd` environment variable prefixes.
 * **[WP_CLI\Utils\esc_like()](https://make.wordpress.org/cli/handbook/internal-api/wp-cli-utils-esc-like/)**–
   First half of escaping for LIKE special characters % and _ before preparing for
   MySQLMySQL MySQL is a relational database management system. A database is a 
   structured collection of data where content, configuration and other options 
   are stored. [https://www.mysql.com](https://www.mysql.com/).

First published

June 12, 2025

Last updated

April 13, 2026

Edit article

[ Improve it on GitHub: [article_title] ](https://github.com/wp-cli/handbook/edit/main/internal-api/wp-cli-utils-parse-ssh-url.md)

Changelog

[ See list of changes: [article_title] ](https://github.com/wp-cli/handbook/commits/main/internal-api/wp-cli-utils-parse-ssh-url.md)

[  Previous: WP_CLI\Utils\normalize_path()](https://make.wordpress.org/cli/handbook/references/internal-api/wp-cli-utils-normalize-path/)

[  Next: WP_CLI\Utils\parse_str_to_argv()](https://make.wordpress.org/cli/handbook/references/internal-api/wp-cli-utils-parse-str-to-argv/)