# How to delete old system indices?

**URL:** <https://discuss.elastic.co/t/how-to-delete-old-system-indices/381146>\
**Category:** Elasticsearch\
**Created:** [August 20, 2025, 2:30am UTC](https://discuss.elastic.co/t/how-to-delete-old-system-indices/381146 "2025-08-20T02:30:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![garethhumphriesgkc](https://avatars.discourse-cdn.com/v4/letter/g/eb8c5e/32.png) [@garethhumphriesgkc](https://discuss.elastic.co/u/garethhumphriesgkc)\
**Post date:** [August 20, 2025, 2:30am UTC](https://discuss.elastic.co/t/how-to-delete-old-system-indices/381146/1 "2025-08-20T02:30:27Z")

</div>

I have a bunch of old indices from old versions I’d like to get rid of to free up disk and shards, e.g.:

- .kibana\_task\_manager\_7.15.2\_001
- .kibana\_task\_manager\_7.17.5\_001
- .kibana\_task\_manager\_8.3.3\_001
- .kibana\_task\_manager\_8.6.0\_001
- .kibana\_7.15.2\_001
- .kibana\_7.17.5\_001
- .kibana\_8.3.3\_00
- .kibana\_8.6.0\_001
- .kibana\_8.11.1\_001

As an admin with superuser privileges, I still can’t delete them though:

```auto
action [indices:admin/delete] is unauthorized for user [*****] with effective roles [superuser] on restricted indices [.kibana_task_manager_8.3.3_001,.kibana_7.17.5_001,.kibana_8.6.0_001,.kibana_task_manager_7.17.5_001,.kibana_task_manager_8.6.0_001,.kibana_7.15.2_001,.kibana_8.11.1_001,.kibana_task_manager_7.15.2_001,.kibana_8.3.3_001], this action is granted by the index privileges [delete_index,manage,all]

```

These aren’t being used by anything (I’ve checked the aliases), so how do I clear them out?

---

<div class="post-metadata">

**Author:** ![ropc](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ropc/32/47022_2.png) [@ropc](https://discuss.elastic.co/u/ropc)\
**Post date:** [August 20, 2025, 4:16am UTC](https://discuss.elastic.co/t/how-to-delete-old-system-indices/381146/2 "2025-08-20T04:16:21Z")

</div>

Hi @garethhumphriesgkc ,

I understand you are trying to delete Kibana indices from older versions. Do make sure that none of these indices are in use, otherwise Kibana will stop working. These indices are created as part of the [saved objects migration](https://www.elastic.co/docs/deploy-manage/upgrade/deployment-or-cluster/saved-object-migrations) and Kibana may be reusing “older” indices if there were no changes of mappings between versions.

If you have checked the list of aliases/indices and confirmed that these indices are not in use, then you can proceed to delete them. In order to do so, you will need to create a temporary role/user that has access to the Kibana system indices:

- Create role:

```auto
PUT _security/role/grant_kibana_system_indices
{
  "indices": [
    {
      "names": [
        ".kibana*"
      ],
      "privileges": [
        "all"
      ],
      "allow_restricted_indices": true
    }
  ]
}

```

- Create temporary user and assign the above role (feel free to change the `password` value):

```auto
POST /_security/user/temporarykibanasuperuser
{
  "password" : "l0ng-r4nd0m-p@ssw0rd",
  "roles" : ["superuser", "grant_kibana_system_indices"]
}

```

You can then use this temporary user to delete the respective Kibana indices.

Delete this temporary role/user once you are done:

```auto
DELETE _security/user/temporarykibanasuperuser
DELETE _security/role/grant_kibana_system_indices

```

---

<div class="post-metadata">

**Author:** ![garethhumphriesgkc](https://avatars.discourse-cdn.com/v4/letter/g/eb8c5e/32.png) [@garethhumphriesgkc](https://discuss.elastic.co/u/garethhumphriesgkc)\
**Post date:** [August 25, 2025, 9:04pm UTC](https://discuss.elastic.co/t/how-to-delete-old-system-indices/381146/3 "2025-08-25T21:04:51Z")

</div>

Thanks.

I’ve just added:

```auto
{
  "names": [
    "*",
    ".*"
  ],
  "privileges": [
    "all"
  ],
  "allow_restricted_indices": true
}

```

to our standard admin role.
