# How do I delete data from elasticsearch within a Range?

**URL:** <https://discuss.elastic.co/t/how-do-i-delete-data-from-elasticsearch-within-a-range/305858>\
**Category:** Elasticsearch\
**Created:** [May 28, 2022, 1:48pm UTC](https://discuss.elastic.co/t/how-do-i-delete-data-from-elasticsearch-within-a-range/305858 "2022-05-28T13:48:31Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![RabBit\_BR](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rabbit_br/32/82261_2.png) [@RabBit\_BR](https://discuss.elastic.co/u/RabBit_BR)\
**Post date:** [May 28, 2022, 2:36pm UTC](https://discuss.elastic.co/t/how-do-i-delete-data-from-elasticsearch-within-a-range/305858/2 "2022-05-28T14:36:45Z")

</div>

Hi!

Read about [Delete by Query](https://discuss.elastic.co/t/delete-by-query-via-timestamp/134451/2). Try this:

```auto
POST teste/_delete_by_query
{
  "query": {
    "range": {
      "field_date": {
        "lt": "2022-05-06",
        "gt": "2022-05-01"
      }
    }
  }
}

```

---

_[View the full topic](https://discuss.elastic.co/t/how-do-i-delete-data-from-elasticsearch-within-a-range/305858)._
