<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -",
    "macOS: 11.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "WebKit",
  "identifier" : "/documentation/WebKit/WKUserContentController/removeAllScriptMessageHandlers(from:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "WebKit"
    ],
    "preciseIdentifier" : "c:objc(cs)WKUserContentController(im)removeAllScriptMessageHandlersFromContentWorld:"
  },
  "title" : "removeAllScriptMessageHandlers(from:)"
}
-->

# removeAllScriptMessageHandlers(from:)

Uninstalls all custom message handlers from the specified content world in your JavaScript code.

```
func removeAllScriptMessageHandlers(from contentWorld: WKContentWorld)
```

## Parameters

`contentWorld`

The content world from which to remove the message handler. For more information about content worlds, see [`WKContentWorld`](/documentation/WebKit/WKContentWorld).

## Discussion

Use this method to remove all message handlers in the specified content world. Message handlers in other content worlds are unaffected.

---

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)