### [wpforms_upload_root](https://wpforms.com/developers/wpforms_upload_root/)

**Published:** March 19, 2021
**Author:** Editorial Team

**Excerpt:** You can use the wpforms_upload_root filter to change the directory of where file uploads are stored when using the WPForms File Upload form field.

**Content:**

## Description

The `wpforms_upload_root` filter is used to define the directory on the server where files uploaded through WPForms are stored.

## Parameters

$wpforms\_upload\_root*(string)* URL used for the default path of storing files uploaded through WPForms.## Source

`wpforms/includes/functions/filesystem-media.php`

## More Information

The `wpforms_upload_root` filter can be used to define where the files uploaded through WPForms are stored.

## Example

```

/**
 * Change the path where file uploads are stored in WPForms.
 *
 * @link    https://wpforms.com/developers/wpforms_upload_root/
 *
 * @param   string  $wpforms_upload_root  root path of where file uploads will be stored.
 * @return  string
 */

function wpf_dev_upload_root( $wpforms_upload_root ) {
 
    //Define the path for your file uploads here
    $wpforms_upload_root = '/home/mysitedomain/public_html/custom-dir';  
        
    return $wpforms_upload_root;
       
}
add_filter( 'wpforms_upload_root', 'wpf_dev_upload_root', 10, 1 );

```

This change will change the location of where the files are stored. This will not update the email notification URL.

## Related

Article Reference: [How to Define a Specific Directory For File Uploads](https://wpforms.com/developers/how-to-define-a-specific-directory-for-file-uploads/ "How to Define a Specific Directory For File Uploads")

**Categories:** Filters Hooks

**Tags:** PHP

---

