# How to delete aliases from template

**URL:** <https://discuss.elastic.co/t/how-to-delete-aliases-from-template/172128>\
**Category:** Elasticsearch\
**Created:** [March 13, 2019, 10:51am UTC](https://discuss.elastic.co/t/how-to-delete-aliases-from-template/172128 "2019-03-13T10:51:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![prabhakar\_talari](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/prabhakar_talari/32/46469_2.png) [@prabhakar\_talari](https://discuss.elastic.co/u/prabhakar_talari)\
**Post date:** [March 13, 2019, 10:51am UTC](https://discuss.elastic.co/t/how-to-delete-aliases-from-template/172128/1 "2019-03-13T10:51:01Z")

</div>

Hi All,

Is there any way to delete alias from template instead of updating template.

Below is the current template

{  
"logstash-batch-test" : {  
"order" : 0,  
"index\_patterns" : [  
"logstash-batch-test\*"  
],  
"settings" : {  
"index" : {  
"number\_of\_shards" : "1",  
"number\_of\_replicas" : "1"  
}  
},  
"mappings" : { },  
"aliases" : {  
"logstash-batch-test" : { }  
}  
}  
}

Now i need to delete aliases from this template as i have lot of templates for those the settings are different so i can not update each and every template instead of that i am looking to remove only aliases from each template. Please suggest any work around for this.

New template should be like

{  
"logstash-batch-test" : {  
"order" : 0,  
"index\_patterns" : [  
"logstash-batch-test\*"  
],  
"settings" : {  
"index" : {  
"number\_of\_shards" : "1",  
"number\_of\_replicas" : "1"  
}  
},  
"mappings" : { }  
}  
}

Thanks

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [March 13, 2019, 11:56am UTC](https://discuss.elastic.co/t/how-to-delete-aliases-from-template/172128/2 "2019-03-13T11:56:22Z")

</div>

> [@prabhakar\_talari](#):
>
> i can not update each and every template instead of that i am looking to remove only aliases from each template.

I'm afraid all you can do is update each template. Can you write a script that loops through all your templates and adjusts them as you want?

---

<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:** [April 10, 2019, 11:56am UTC](https://discuss.elastic.co/t/how-to-delete-aliases-from-template/172128/3 "2019-04-10T11:56:23Z")

</div>

Closed on April 10, 2019, 11:56am UTC

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