---
title: MEContentBlocker
framework: mailkit
role: symbol
role_heading: Protocol
path: mailkit/mecontentblocker
---

# MEContentBlocker

An object that provides a set of rules to block content when displaying a message.

## Declaration

```swift
protocol MEContentBlocker : NSObjectProtocol
```

## Overview

Overview A mail content blocker is similar to content blockers for Safari. Mail uses content blockers when it displays message content in a user’s mailbox. If your extension’s Info.plist file contains MEContentBlocker in the list of MEExtensionCapabilities, MailKit invokes handlerForContentBlocker() to get the object that provides content-blocking rules. The handler returns the content-blocking rules as JSON data from the contentRulesJSON() method. For more information about content blockers, see Creating a content blocker. note: MailKit always applies content-blocking rules for enabled extensions. This is true even if the user clicks the “Load remote content” button on the banner that Mail displays when remote content isn’t loaded. To indicate that your extension contains a content blocker, add MEContentBlocker to the MEExtensionCapabilities array in the extension’s Info.plist file: <key>NSExtensionAttributes</key> <dict>     <key>MEExtensionCapabilities</key>     <array>         <string>MEContentBlocker</string>     </array> </dict>

## Topics

### Defining Rules to Block Content

- [contentRulesJSON()](mailkit/mecontentblocker/contentrulesjson().md)

## Relationships

### Inherits From

- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
