# How to disable automatic creation of document types?

**URL:** <https://discuss.elastic.co/t/how-to-disable-automatic-creation-of-document-types/32573>\
**Category:** Elasticsearch\
**Created:** [October 20, 2015, 1:49pm UTC](https://discuss.elastic.co/t/how-to-disable-automatic-creation-of-document-types/32573 "2015-10-20T13:49:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mos/32/4898_2.png) [@mos](https://discuss.elastic.co/u/mos)\
**Post date:** [October 20, 2015, 1:49pm UTC](https://discuss.elastic.co/t/how-to-disable-automatic-creation-of-document-types/32573/1 "2015-10-20T13:49:19Z")

</div>

We need to prevent creating new types in a specific index?

Dynamic index creation can be disabled via: `action.auto_create_index: false (via config/elasticsearch.yml)`  
Dynamic field mapping can be disable during mapping definition: `"dynamic": "strict"`

How can I disable this for a document-type? Is this possible at index creation time?

---

<div class="post-metadata">

**Author:** ![cbuescher](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cbuescher/32/60402_2.png) [@cbuescher](https://discuss.elastic.co/u/cbuescher)\
**Post date:** [October 20, 2015, 3:53pm UTC](https://discuss.elastic.co/t/how-to-disable-automatic-creation-of-document-types/32573/2 "2015-10-20T15:53:07Z")

</div>

Did you try `"index.mapper.dynamic" : "false"`? According to the explanation given for [Mappers](https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules-mapper.html) this should work.

---

<div class="post-metadata">

**Author:** ![mos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mos/32/4898_2.png) [@mos](https://discuss.elastic.co/u/mos)\
**Post date:** [October 21, 2015, 9:04am UTC](https://discuss.elastic.co/t/how-to-disable-automatic-creation-of-document-types/32573/3 "2015-10-21T09:04:46Z")

</div>

Thanks Christoph, that works!  
I thought it could only be used in the _elasticsearch.yml_ globally. But it works also at index-creation time in the settings.

---

<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:** [July 5, 2017, 11:43pm UTC](https://discuss.elastic.co/t/how-to-disable-automatic-creation-of-document-types/32573/4 "2017-07-05T23:43:39Z")

</div>


