# PUT mapping doesn't actually replace the mapping but only "updates" it with new fields

**URL:** <https://discuss.elastic.co/t/put-mapping-doesnt-actually-replace-the-mapping-but-only-updates-it-with-new-fields/381203>\
**Category:** Elasticsearch\
**Created:** [August 21, 2025, 10:50am UTC](https://discuss.elastic.co/t/put-mapping-doesnt-actually-replace-the-mapping-but-only-updates-it-with-new-fields/381203 "2025-08-21T10:50:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![albertino87](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/albertino87/32/137334_2.png) [@albertino87](https://discuss.elastic.co/u/albertino87)\
**Post date:** [August 21, 2025, 10:50am UTC](https://discuss.elastic.co/t/put-mapping-doesnt-actually-replace-the-mapping-but-only-updates-it-with-new-fields/381203/1 "2025-08-21T10:50:55Z")

</div>

good morning,

I have elasticsearch 7.17. I noticed that if I have a mapping in an existing index and then i use PUT mapping, it doesn’t replace the mapping with the new one as I would expect, but simply updates it with the new keys. You can find below a way to reproduce the error. I would expect that the final GET returns the last schema I put but that’s not the case

```auto
PUT my-index-000001

PUT /my-index-000001/_mapping
{
  "dynamic": "strict",
  "properties": {
    "main_property": {
      "properties": {
        "old_property": {
          "type": "long"
        }
      }
    }
  }
}

PUT /my-index-000001/_mapping
{
  "dynamic": "strict",
  "properties": {
    "main_property": {
      "properties": {
        "new_property_1": {
          "properties": {
            "sub_property": {
              "type": "long"
            }
          }
        },
        "new_property_2": {
          "properties": {
            "sub_property": {
              "type": "long"
            }
          }
        }
      }
    }
  }
}

GET my-index-000001

```

if this method doesn’t work, how can I replace a mapping?

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [August 21, 2025, 11:04am UTC](https://discuss.elastic.co/t/put-mapping-doesnt-actually-replace-the-mapping-but-only-updates-it-with-new-fields/381203/2 "2025-08-21T11:04:27Z")

</div>

You [can not change or remove existing mappings in an index in Elasticsearch](https://www.elastic.co/guide/en/elasticsearch/reference/8.19/mapping.html#mapping-manage-update), only add new ones. If you do need to remove something you will need to create a new index with the correct mapping and reindex the data.
