---
title: "removeAllScriptMessageHandlers(from:)"
framework: webkit
role: symbol
role_heading: Instance Method
path: "webkit/wkusercontentcontroller/removeallscriptmessagehandlers(from:)"
---

# removeAllScriptMessageHandlers(from:)

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

## Declaration

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

## Parameters

- `contentWorld`: The content world from which to remove the message handler. For more information about content worlds, see doc://com.apple.webkit/documentation/WebKit/WKContentWorld.

## Discussion

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

## See Also

### Adding and Removing Message Handlers

- [add(_:name:)](webkit/wkusercontentcontroller/add(_:name:).md)
- [add(_:contentWorld:name:)](webkit/wkusercontentcontroller/add(_:contentworld:name:).md)
- [addScriptMessageHandler(_:contentWorld:name:)](webkit/wkusercontentcontroller/addscriptmessagehandler(_:contentworld:name:).md)
- [removeScriptMessageHandler(forName:)](webkit/wkusercontentcontroller/removescriptmessagehandler(forname:).md)
- [removeScriptMessageHandler(forName:contentWorld:)](webkit/wkusercontentcontroller/removescriptmessagehandler(forname:contentworld:).md)
- [removeAllScriptMessageHandlers()](webkit/wkusercontentcontroller/removeallscriptmessagehandlers().md)
- [WKScriptMessageHandler](webkit/wkscriptmessagehandler.md)
- [WKScriptMessageHandlerWithReply](webkit/wkscriptmessagehandlerwithreply.md)
