<!--
{
  "availability" : [
    "iOS: 11.0.0 -",
    "iPadOS: 11.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.13.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "WebKit",
  "identifier" : "/documentation/WebKit/WKContentRuleListStore",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "WebKit"
    ],
    "preciseIdentifier" : "c:objc(cs)WKContentRuleListStore"
  },
  "title" : "WKContentRuleListStore"
}
-->

# WKContentRuleListStore

An object that contains the rules for how to load and filter content in the web view.

```
@MainActor class WKContentRuleListStore
```

## Overview

Use a [`WKContentRuleListStore`](/documentation/WebKit/WKContentRuleListStore) to compile and manage rules for filtering content in a web view. Rule lists act as content blockers inside your app. You use them to prevent the web view from loading specific content, either based on the original location of that content or other criteria you specify. For example, a corporate app might use rules to prevent the web view from loading content that originates from outside the corporate network.

Fetch the default [`WKContentRuleListStore`](/documentation/WebKit/WKContentRuleListStore) object or create a custom store object and use it to compile or access the available rules. Each store object stores its existing rules persistently in the file system and loads those rules at creation time. A store object doesn’t automatically apply any of its rules to a particular web view. To apply a rule to a web view, add it to the [`WKUserContentController`](/documentation/WebKit/WKUserContentController) object of the web view’s configuration object.

## Topics

### Creating a Content Rule List Store

[`default()`](/documentation/WebKit/WKContentRuleListStore/default())

Returns the default content rule list store.

[`init(url:)`](/documentation/WebKit/WKContentRuleListStore/init(url:)-dile)

Creates a new content rule list store in the specified directory.

### Creating and Deleting Content Rule Lists

[`compileContentRuleList(forIdentifier:encodedContentRuleList:completionHandler:)`](/documentation/WebKit/WKContentRuleListStore/compileContentRuleList(forIdentifier:encodedContentRuleList:completionHandler:))

Compiles the specified JSON content into a new rule list and adds it to the current data store.

[`removeContentRuleList(forIdentifier:completionHandler:)`](/documentation/WebKit/WKContentRuleListStore/removeContentRuleList(forIdentifier:completionHandler:))

Removes a rule list from the current data store asynchronously.

### Accessing the Current Rule Lists

[`getAvailableContentRuleListIdentifiers(_:)`](/documentation/WebKit/WKContentRuleListStore/getAvailableContentRuleListIdentifiers(_:))

Fetches the identifiers for all rule lists in the store asynchronously.

[`lookUpContentRuleList(forIdentifier:completionHandler:)`](/documentation/WebKit/WKContentRuleListStore/lookUpContentRuleList(forIdentifier:completionHandler:))

Searches asynchronously for a specific rule list in the data store.



---

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)