<!--
{
  "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/WKContentRuleList",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "WebKit"
    ],
    "preciseIdentifier" : "c:objc(cs)WKContentRuleList"
  },
  "title" : "WKContentRuleList"
}
-->

# WKContentRuleList

A compiled list of rules to apply to web content.

```
@MainActor class WKContentRuleList
```

## Overview

A [`WKContentRuleList`](/documentation/WebKit/WKContentRuleList) object represents a compiled set of rules for modifying how a webpage loads content. You don’t create a [`WKContentRuleList`](/documentation/WebKit/WKContentRuleList) directly. Instead, you specify your rules in JSON format and compile them using the [`compileContentRuleList(forIdentifier:encodedContentRuleList:completionHandler:)`](/documentation/WebKit/WKContentRuleListStore/compileContentRuleList(forIdentifier:encodedContentRuleList:completionHandler:)) method of [`WKContentRuleListStore`](/documentation/WebKit/WKContentRuleListStore). That method compiles your rules into an efficient byte format and returns them in an instance of this class.

Content rule lists use the same syntax as content blocker extensions in Safari. For more information on how to specify the JSON for your rule lists, see <doc://com.apple.documentation/documentation/SafariServices/creating-a-content-blocker>.

## Topics

### Getting the Rules List Identifier

[`identifier`](/documentation/WebKit/WKContentRuleList/identifier)

The identifier for the rule list.



---

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)