# How to delete a field from a document?

**URL:** https://discuss.elastic.co/t/how-to-delete-a-field-from-a-document/22311
**Category:** Elasticsearch
**Created:** [February 22, 2015, 9:49am UTC](https://discuss.elastic.co/t/how-to-delete-a-field-from-a-document/22311 "2015-02-22T09:49:43Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Sacheendra\_Talluri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sacheendra_talluri/32/780_2.png) [@Sacheendra\_Talluri](https://discuss.elastic.co/u/Sacheendra_Talluri)
#### Post date: [February 22, 2015, 9:49am UTC](https://discuss.elastic.co/t/how-to-delete-a-field-from-a-document/22311/1 "2015-02-22T09:49:43Z")

</div>

One way I found was to use a script as was mentioned here:  
[http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-update.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-update.html)  
There is an example of how to remove a field from a document.

Is there any other way this can be achieved?  
For example, if i want to delete the field "field1" from a document, would  
the below request do that?  
curl -XPOST 'localhost:9200/test/type1/1/\_update' -d '{  
"field1": null  
}'

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/b91c8b07-1859-4a71-bc5a-70693ac7fcc3%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b91c8b07-1859-4a71-bc5a-70693ac7fcc3%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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 6, 2017, 12:30am UTC](https://discuss.elastic.co/t/how-to-delete-a-field-from-a-document/22311/2 "2017-07-06T00:30:58Z")

</div>


