<!--
{
  "availability" : [
    "macOS: 10.3.0 - 10.14.0"
  ],
  "documentType" : "symbol",
  "framework" : "WebKit",
  "identifier" : "/documentation/WebKit/WebHistory/addItems(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "WebKit"
    ],
    "preciseIdentifier" : "c:objc(cs)WebHistory(im)addItems:"
  },
  "title" : "addItems(_:)"
}
-->

# addItems(_:)

Inserts or updates the specified items in the web history.

```
func addItems(_ newItems: [Any]!)
```

## Parameters

`newItems`

An array of web history items to add. If an item in the array already exists in the web history this method replaces the existing item, so that the last-visited date for the item is updated.

## Discussion

When successful, this method posts a notification ([`WebHistoryItemsAddedNotification`](/documentation/WebKit/WebHistoryItemsAddedNotification)).

---

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)