How to delete an index in Elasticsearch

Deleting an index in Elasticsearch permanently removes its documents, shards, and index metadata, which is useful for retiring old time-based indices, clearing disposable test data, or reclaiming disk space after a successful rollover or migration.

The Delete index API works on concrete index names, not aliases, and current Elastic defaults keep destructive requests conservative. In current releases, wildcard deletes and _all are blocked unless the cluster setting action.destructive_requires_name is turned off, so the safest workflow is to inspect the exact index first and delete that one name only. Deleting an index removes the index itself, but it does not remove related Kibana data views, visualizations, or dashboards that referenced it.

Because the operation is irreversible without a snapshot, confirm the index is no longer the active write target before deleting it. If the target belongs to a data stream and is still the current write index, Elasticsearch rejects the request until the stream is rolled over to a new backing index. The caller also needs the delete_index privilege, and secured clusters may require HTTPS plus authentication instead of the local http://localhost:9200 examples shown here.

Steps to delete an index in Elasticsearch:

  1. List indices to confirm the exact target name before deleting anything.
    $ curl -sS --fail "http://localhost:9200/_cat/indices?v&s=index"
    health status index           uuid                   pri rep docs.count docs.deleted store.size pri.store.size dataset.size
    green  open   logs-2026.01    ACO7eo4YQL65aGNc0Qny5A   1   0          1            0      4.8kb          4.8kb        4.8kb
    green  open   logs-2026.02    wKX5e1v-Slm6eXsOrB4xgA   1   0          1            0      4.8kb          4.8kb        4.8kb
    green  open   metrics-2026.02 VF0x_M9ETKmAy_rO8PTYNQ   1   0          1            0      4.8kb          4.8kb        4.8kb

    The _cat APIs are intended for human-readable checks. Replace http://localhost:9200 with the real endpoint and add authentication options when cluster security is enabled.

  2. Inspect the target index so aliases or data stream membership do not surprise the delete request.
    $ curl -sS --fail "http://localhost:9200/logs-2026.01?pretty&filter_path=*.aliases,*.data_stream,*.settings.index.number_of_replicas,*.settings.index.number_of_shards"
    {
      "logs-2026.01" : {
        "aliases" : { },
        "settings" : {
          "index" : {
            "number_of_shards" : "1",
            "number_of_replicas" : "0"
          }
        }
      }
    }

    If aliases is populated, confirm applications no longer rely on that index as an alias target. If data_stream appears, check whether the index is still the stream's current write index before continuing.

  3. Delete the exact index name.
    $ curl -sS --fail -X DELETE "http://localhost:9200/logs-2026.01?pretty"
    {
      "acknowledged" : true
    }

    Deleting an index permanently removes its documents, shards, and metadata. The API does not accept aliases, and the current write index of a data stream must be rolled over before it can be deleted.

    This guide intentionally uses the full concrete name instead of a wildcard because action.destructive_requires_name blocks wildcard deletes by default.

  4. Confirm the deleted index name now returns HTTP 404.
    $ curl -sS -o /dev/null -w "%{http_code}\n" "http://localhost:9200/_cat/indices/logs-2026.01?v"
    404

    HTTP 200 indicates the index still exists or the check reached a different cluster endpoint than the delete request.

  5. List the remaining indices to confirm only the intended target was removed.
    $ curl -sS --fail "http://localhost:9200/_cat/indices/logs-2026.02,metrics-2026.02?v&s=index"
    health status index           uuid                   pri rep docs.count docs.deleted store.size pri.store.size dataset.size
    green  open   logs-2026.02    wKX5e1v-Slm6eXsOrB4xgA   1   0          1            0      4.8kb          4.8kb        4.8kb
    green  open   metrics-2026.02 VF0x_M9ETKmAy_rO8PTYNQ   1   0          1            0      4.8kb          4.8kb        4.8kb

    If index cleanup is recurring work, move the retention logic into an ILM policy so future old indices are deleted on schedule instead of manually.