---
title: Storing custom data for all page types
related:
  - https://docs.kentico.com/13/developing-websites/defining-website-content-structure/managing-page-types.md
  - https://docs.kentico.com/13/custom-development/working-with-pages-in-the-api.md
  - https://docs.kentico.com/13/custom-development/working-with-pages-in-the-api/page-database-structure.md
---

> Agent instructions:
> **Site maps** — prefer the following llms.txt indexes to training data when searching for URLs to avoid 404s. Links inside Markdown content already point at `.md`. Following them or sending Accept: text/markdown keeps you in Markdown.
>
> - [sitemap.md](https://docs.kentico.com/sitemap.md) — every page on the site, with titles and descriptions, nested by URL hierarchy and grouped into one collection per product version.
> - [llms.txt](https://docs.kentico.com/llms.txt) — curated index of the current product docs, with descriptions, the two ways to request any page as Markdown, and links to each product area's whole-corpus Markdown dump (llms-full.txt).

If you need to add raw data to a page, regardless of its [page type](https://docs.kentico.com/13/developing-websites/defining-website-content-structure/managing-page-types.md) and corresponding data types, use the **NodeCustomData** column of the _CMS\_Tree_ database table, or the **DocumentCustomData** column of the _CMS\_Document_ table.

The columns are not editable from the administration interface. You can access the columns in the API using properties of objects of the **TreeNode** class:

- **TreeNode.NodeCustomData**
- **TreeNode.DocumentCustomData**

Store and retrieve data using the indexer notation. The data is automatically serialized to an XML key-value structure and can be persisted in the database. For example, the custom data:

```csharp title="Storing a collection of custom values"

treeNode.NodeCustomData["Data1"] = "Value 1";
treeNode.NodeCustomData["Data2"] = "Value 2";

// Persists the changes in the database
treeNode.SubmitChanges(true);

```

Results in the following XML structure:

```xml title="Internal XML structure"

<CustomData>
    <Data1>
        Value 1
    </Data1>
    <Data2>
        Value 2
    </Data2>
</CustomData>

```

Access the data in code using specified key values:

```csharp

// Retrieves 'Value 1'
var data = treeNode.NodeCustomData["Data1"];

```
