# Can dynamic mapping templates block a particular field from being mapped?

**URL:** https://discuss.elastic.co/t/can-dynamic-mapping-templates-block-a-particular-field-from-being-mapped/311837
**Category:** Elasticsearch
**Created:** [August 10, 2022, 1:45pm UTC](https://discuss.elastic.co/t/can-dynamic-mapping-templates-block-a-particular-field-from-being-mapped/311837 "2022-08-10T13:45:41Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![nisow95612](https://avatars.discourse-cdn.com/v4/letter/n/3d9bf3/32.png) [@nisow95612](https://discuss.elastic.co/u/nisow95612)
#### Post date: [August 10, 2022, 1:45pm UTC](https://discuss.elastic.co/t/can-dynamic-mapping-templates-block-a-particular-field-from-being-mapped/311837/1 "2022-08-10T13:45:41Z")

</div>

I have an index template set to `"dynamic": "enable"`, which causes all fields to be added into the mapping. But what if there are fields that I explicitely do not want to be mapped?

I know that [dynamic templates](https://www.elastic.co/guide/en/elasticsearch/reference/current/dynamic-templates.html) can change the type for fields that match a pattern. They can also turn the field into a runtime one. But can dynamic templates prevent a paritcular field from mapping at all?

* * *

When searching I found [Enabled = false, still indexing everything in kibana](https://discuss.elastic.co/t/enabled-false-still-indexing-everything-in-kibana/168894), but unfortunately setting `"enabled": "false"` does not seem to prevent the field from being mapped.

* * *

This question is inspired by [Documentation for dynamic template mappings? - #3 by nisow95612](https://discuss.elastic.co/t/documentation-for-dynamic-template-mappings/311746/3) and [Mapping: trying to ignore 'field' but keeping 'field.raw'](https://discuss.elastic.co/t/mapping-trying-to-ignore-field-but-keeping-field-raw/92621)

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [September 7, 2022, 1:46pm UTC](https://discuss.elastic.co/t/can-dynamic-mapping-templates-block-a-particular-field-from-being-mapped/311837/2 "2022-09-07T13:46:20Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
