# Removing empty indices

**URL:** <https://discuss.elastic.co/t/removing-empty-indices/388901>\
**Category:** Elasticsearch\
**Created:** [July 30, 2026, 12:47pm UTC](https://discuss.elastic.co/t/removing-empty-indices/388901 "2026-07-30T12:47:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bbreer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bbreer/32/130059_2.png) [@bbreer](https://discuss.elastic.co/u/bbreer)\
**Post date:** [July 30, 2026, 12:47pm UTC](https://discuss.elastic.co/t/removing-empty-indices/388901/1 "2026-07-30T12:47:02Z")

</div>

I would like to remove these empty indices because I need to free up the shards.

 ![Screenshot 2026-07-30 084026](https://us1.discourse-cdn.com/elastic/original/3X/2/c/2c491956e44fbcc6ffb16f86e843186c91ed80a5.png)

I know this is a restricted data stream which may be why no matter what privileges i add to the role, I still can't delete them. Any one else run into this issue?

Thanks.

---

<div class="post-metadata">

**Author:** ![covj12](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/covj12/32/147474_2.png) [@covj12](https://discuss.elastic.co/u/covj12)\
**Post date:** [July 30, 2026, 11:58pm UTC](https://discuss.elastic.co/t/removing-empty-indices/388901/2 "2026-07-30T23:58:06Z")

</div>

`superuser` can't touch restricted indices by default. Add a role with `allow_restricted_indices: true` scoped to just that index, then delete.

> **[Indices privileges - Defining roles | Elasticsearch Guide \[8.18\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/8.18/defining-roles.html#roles-indices-priv)**
>
> A role is defined by the following JSON structure:

---

<div class="post-metadata">

**Author:** ![bbreer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bbreer/32/130059_2.png) [@bbreer](https://discuss.elastic.co/u/bbreer)\
**Post date:** [July 31, 2026, 12:37pm UTC](https://discuss.elastic.co/t/removing-empty-indices/388901/3 "2026-07-31T12:37:59Z")

</div>

Thank you for takign the time to reply. Yes, I read that when I was googling. The problem is that the _allow\_restricted\_indices_ privilege doesn't appear in the drop-down menu of index privileges able to be assigned to a role.

 ![Screenshot 2026-07-31 083703](https://us1.discourse-cdn.com/elastic/original/3X/d/0/d0d8ac794116f5c021ba4895563d7a0f4a0b19a7.png)

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [July 31, 2026, 12:43pm UTC](https://discuss.elastic.co/t/removing-empty-indices/388901/4 "2026-07-31T12:43:19Z")

</div>

You need to create a role manually, with a request on Dev Tools, something like this:

```auto
POST /_security/role/fleet_superuser
{
  "indices": [
    {
      "names": [".ds-.fleet-actions-*"],
      "privileges": ["all"],
      "allow_restricted_indices": true
    }
  ]
}

```
