# How can I delete all the stored scripts?

**URL:** <https://discuss.elastic.co/t/how-can-i-delete-all-the-stored-scripts/183274>\
**Category:** Elasticsearch\
**Created:** [May 29, 2019, 8:32am UTC](https://discuss.elastic.co/t/how-can-i-delete-all-the-stored-scripts/183274 "2019-05-29T08:32:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![goniaks](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/goniaks/32/46043_2.png) [@goniaks](https://discuss.elastic.co/u/goniaks)\
**Post date:** [May 29, 2019, 8:32am UTC](https://discuss.elastic.co/t/how-can-i-delete-all-the-stored-scripts/183274/1 "2019-05-29T08:32:26Z")

</div>

This way I can delete 1:  
DELETE \_scripts/my\_script

I just want to delete them all, I don't know the list of scripts I have stored.

---

<div class="post-metadata">

**Author:** ![rjernst](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rjernst/32/6363_2.png) [@rjernst](https://discuss.elastic.co/u/rjernst)\
**Post date:** [June 20, 2019, 11:46pm UTC](https://discuss.elastic.co/t/how-can-i-delete-all-the-stored-scripts/183274/2 "2019-06-20T23:46:55Z")

</div>

There is not currently any way to do this. There is an open issue ([https://github.com/elastic/elasticsearch/issues/25179](https://github.com/elastic/elasticsearch/issues/25179)) to be able to retrieve all scripts, which would be similar to this. You could open a new feature request issue, or start by mentioning the idea on that issue.

---

<div class="post-metadata">

**Author:** ![martinr\_ubi](https://avatars.discourse-cdn.com/v4/letter/m/b5e925/32.png) [@martinr\_ubi](https://discuss.elastic.co/u/martinr_ubi)\
**Post date:** [June 21, 2019, 10:59am UTC](https://discuss.elastic.co/t/how-can-i-delete-all-the-stored-scripts/183274/3 "2019-06-21T10:59:39Z")

</div>

To know what you have stored:

```auto
GET _cluster/state/metadata?pretty&filter_path=**.stored_scripts

```

From this, know that you get this info from the cluster state, you can toy with the filter to filter server side if desired, or not...Then build on this for automation, or simply get the list once and ref it if you want to manually delete something, see what's there.

---

<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 19, 2019, 10:59am UTC](https://discuss.elastic.co/t/how-can-i-delete-all-the-stored-scripts/183274/4 "2019-07-19T10:59:40Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
