# Multiple replace?

**URL:** https://discourse.gohugo.io/t/multiple-replace/26243
**Category:** support
**Created:** [June 14, 2020, 12:52am UTC](https://discourse.gohugo.io/t/multiple-replace/26243 "2020-06-14T00:52:40Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![short](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/short/32/11382_2.png) [@short](https://discourse.gohugo.io/u/short)
#### Post date: [June 14, 2020, 12:52am UTC](https://discourse.gohugo.io/t/multiple-replace/26243/1 "2020-06-14T00:52:40Z")

</div>

Hi guys

Is it possible to do multiple replace in 1 line?

---

<div class="post-metadata">

### Author: ![short](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/short/32/11382_2.png) [@short](https://discourse.gohugo.io/u/short)
#### Post date: [June 14, 2020, 1:17am UTC](https://discourse.gohugo.io/t/multiple-replace/26243/2 "2020-06-14T01:17:26Z")

</div>

`{{ $nummers_nr := replace .Params.url "maddie-and-tae" "maddie-tae" }}`

How can I add also replace “big-and-rich” with “big-rich” ?

---

<div class="post-metadata">

### Author: ![davidsneighbour](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/davidsneighbour/32/24507_2.png) [@davidsneighbour](https://discourse.gohugo.io/u/davidsneighbour)
#### Post date: [June 14, 2020, 2:46am UTC](https://discourse.gohugo.io/t/multiple-replace/26243/3 "2020-06-14T02:46:14Z")

</div>

> **[replace](https://gohugo.io/functions/replace/#readout)**
>
> Replaces all occurrences of the search string with the replacement string.

no.

There is a function called dict, so there might be a way to work with a loop and a dict, but not a one liner.

> **[dict](https://gohugo.io/functions/dict/#readout)**
>
> Creates a dictionary from a list of key and value pairs.

---

<div class="post-metadata">

### Author: ![short](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/short/32/11382_2.png) [@short](https://discourse.gohugo.io/u/short)
#### Post date: [June 14, 2020, 2:54am UTC](https://discourse.gohugo.io/t/multiple-replace/26243/4 "2020-06-14T02:54:13Z")

</div>

i figured it out already how to do it in 1 line hehe

---

<div class="post-metadata">

### Author: ![davidsneighbour](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/davidsneighbour/32/24507_2.png) [@davidsneighbour](https://discourse.gohugo.io/u/davidsneighbour)
#### Post date: [June 14, 2020, 3:00am UTC](https://discourse.gohugo.io/t/multiple-replace/26243/5 "2020-06-14T03:00:39Z")

</div>

Then post your solution so everyone can learn something new 🙂

---

<div class="post-metadata">

### Author: ![short](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/short/32/11382_2.png) [@short](https://discourse.gohugo.io/u/short)
#### Post date: [June 14, 2020, 8:26am UTC](https://discourse.gohugo.io/t/multiple-replace/26243/6 "2020-06-14T08:26:51Z")

</div>

`{{ $nummers_nr := replace ( replace .Params.url "big-and-rich" "big-rich" ) "maddie-and-tae" "maddie-tae" }}`

🙂

---

<div class="post-metadata">

### Author: ![system](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/system/32/1_2.png) [@system](https://discourse.gohugo.io/u/system)
#### Post date: [June 16, 2020, 8:26am UTC](https://discourse.gohugo.io/t/multiple-replace/26243/7 "2020-06-16T08:26:54Z")

</div>

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