# Deleting index type in 2.2

**URL:** <https://discuss.elastic.co/t/deleting-index-type-in-2-2/44079>\
**Category:** Elasticsearch\
**Created:** [March 10, 2016, 8:04pm UTC](https://discuss.elastic.co/t/deleting-index-type-in-2-2/44079 "2016-03-10T20:04:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pradeep\_Gowda](https://avatars.discourse-cdn.com/v4/letter/p/ebca7d/32.png) [@Pradeep\_Gowda](https://discuss.elastic.co/u/Pradeep_Gowda)\
**Post date:** [March 10, 2016, 8:04pm UTC](https://discuss.elastic.co/t/deleting-index-type-in-2-2/44079/1 "2016-03-10T20:04:22Z")

</div>

In post 2.0, I was using adminClient.indices().prepareDelete(index , type) to delete index type. But this is not working in 2.0 and above. How can I delete a particular index type?

Regards,

---

<div class="post-metadata">

**Author:** ![mvg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mvg/32/98890_2.png) [@mvg](https://discuss.elastic.co/u/mvg)\
**Post date:** [March 11, 2016, 9:12am UTC](https://discuss.elastic.co/t/deleting-index-type-in-2-2/44079/2 "2016-03-11T09:12:49Z")

</div>

From 2.0 and later, a type can't be deleted any more. You can either remove all documents from this type (for example by using delete by query plugin) or remove the entire index. The latter will obviously also delete all the other types.

---

<div class="post-metadata">

**Author:** ![Stephane\_Steph](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephane_steph/32/8426_2.png) [@Stephane\_Steph](https://discuss.elastic.co/u/Stephane_Steph)\
**Post date:** [March 11, 2016, 9:18am UTC](https://discuss.elastic.co/t/deleting-index-type-in-2-2/44079/3 "2016-03-11T09:18:38Z")

</div>

Hi,  
You have to install the plugin delete-by-query : [https://www.elastic.co/guide/en/elasticsearch/plugins/2.2/plugins-delete-by-query.html](https://www.elastic.co/guide/en/elasticsearch/plugins/2.2/plugins-delete-by-query.html)  
example : curl -XDELETE '[http://l000bsy001:9200/myindex/\_query?q=\_type:mytype](http://l000bsy001:9200/myindex/_query?q=_type:mytype)'

It works fine

---

<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:09pm UTC](https://discuss.elastic.co/t/deleting-index-type-in-2-2/44079/4 "2017-07-05T23:09:13Z")

</div>


