<!--
{
  "availability" : [
    "iOS: 11.0.0 -",
    "iPadOS: 11.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "FileProvider",
  "identifier" : "/documentation/FileProvider/NSFileProviderManager/writePlaceholder(at:withMetadata:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "File Provider"
    ],
    "preciseIdentifier" : "c:objc(cs)NSFileProviderManager(cm)writePlaceholderAtURL:withMetadata:error:"
  },
  "title" : "writePlaceholder(at:withMetadata:)"
}
-->

# writePlaceholder(at:withMetadata:)

Writes a document placeholder with the provided metadata.

```
class func writePlaceholder(at placeholderURL: URL, withMetadata metadata: NSFileProviderItem) throws
```

## Parameters

`placeholderURL`

The placeholder URL for the document. You can generate a placeholder URL from a document URL by calling [`placeholderURL(for:)`](/documentation/FileProvider/NSFileProviderExtension/placeholderURL(for:)).

`metadata`

The metadata for this document.

## Discussion

Call this method whenever you need to create a placeholder for a document. The metadata that you provide sets the data provided to the user in the browser interface.

> Note:
> While this method is available on macOS 11+, you don’t need to use it when creating a file provider extension that adopts the ``doc://com.apple.fileprovider/documentation/FileProvider/NSFileProviderReplicatedExtension`` protocol.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)