---
title: Storing custom data for all document types
related:
  - https://docs.kentico.com/k8/developing-websites/defining-website-data-structure/document-types.md
  - https://docs.kentico.com/k8/managing-website-content/working-with-documents-and-pages.md
  - https://docs.kentico.com/k8/custom-development/working-with-documents-in-the-api/document-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 custom data fields to all documents, regardless of document type, use the **NodeCustomData** column of the _CMS\_Tree_ database table, or the **DocumentCustomData** column of the _CMS\_Document_ table.

You can access the columns in the API using properties of objects of the **TreeNode** class:

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

The properties provide two ways to store values:

```csharp title="Storing a single ntext value"

treeNode.NodeCustomData.Value = "Single block of text";

```

```csharp title="Storing a collection of custom values in XML format"

treeNode.NodeCustomData["CustomProperty1"] = "Value 1";
treeNode.NodeCustomData["CustomProperty2"] = "Value 2";

```
