Title: request_filesystem_credentials
Published: April 25, 2014
Last modified: May 20, 2026

---

# apply_filters( ‘request_filesystem_credentials’, mixed $credentials, string $form_post, string $type, bool|WP_Error $error, string $context, array $extra_fields, bool $allow_relaxed_file_ownership )

## In this article

 * [Description](https://developer.wordpress.org/reference/hooks/request_filesystem_credentials/?output_format=md#description)
 * [Parameters](https://developer.wordpress.org/reference/hooks/request_filesystem_credentials/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/hooks/request_filesystem_credentials/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/hooks/request_filesystem_credentials/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/hooks/request_filesystem_credentials/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/hooks/request_filesystem_credentials/?output_format=md#wp--skip-link--target)

Filters the filesystem credentials.

## 󠀁[Description](https://developer.wordpress.org/reference/hooks/request_filesystem_credentials/?output_format=md#description)󠁿

Returning anything other than an empty string will effectively short-circuit output
of the filesystem credentials form, returning that value instead.

A filter should return true if no filesystem credentials are required, false if 
they are required but have not been provided, or an array of credentials if they
are required and have been provided.

## 󠀁[Parameters](https://developer.wordpress.org/reference/hooks/request_filesystem_credentials/?output_format=md#parameters)󠁿

 `$credentials`mixed

Credentials to return instead. Default empty string.

`$form_post`string

The URL to post the form to.

`$type`string

Chosen type of filesystem.

`$error`bool|[WP_Error](https://developer.wordpress.org/reference/classes/wp_error/)

Whether the current request has failed to connect, or an error object.

`$context`string

Full path to the directory that is tested for being writable.

`$extra_fields`array

Extra POST fields.

`$allow_relaxed_file_ownership`bool

Whether to allow Group/World writable.

## 󠀁[Source](https://developer.wordpress.org/reference/hooks/request_filesystem_credentials/?output_format=md#source)󠁿

    ```php
    $req_cred = apply_filters( 'request_filesystem_credentials', '', $form_post, $type, $error, $context, $extra_fields, $allow_relaxed_file_ownership );
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/file.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-admin/includes/file.php#L2389)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-admin/includes/file.php#L2389-L2389)

## 󠀁[Related](https://developer.wordpress.org/reference/hooks/request_filesystem_credentials/?output_format=md#related)󠁿

| Used by | Description | 
| [request_filesystem_credentials()](https://developer.wordpress.org/reference/functions/request_filesystem_credentials/)`wp-admin/includes/file.php` |

Displays a form to the user to request for their FTP/SSH details in order to connect to the filesystem.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/hooks/request_filesystem_credentials/?output_format=md#changelog)󠁿

| Version | Description | 
| [4.6.0](https://developer.wordpress.org/reference/since/4.6.0/) | The `$context` parameter default changed from `false` to an empty string. | 
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Frequest_filesystem_credentials%2F)
before being able to contribute a note or feedback.