# multiple replaces on a richtext

**URL:** <https://community.hubspot.com/t/multiple-replaces-on-a-richtext/83577>\
**Category:** CMS Development\
**Tags:** professional\
**Created:** [June 16, 2023, 1:02pm UTC](https://community.hubspot.com/t/multiple-replaces-on-a-richtext/83577 "2023-06-16T13:02:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Elty](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/elty/32/58580_2.png) [@Elty](https://community.hubspot.com/u/Elty)\
**Post date:** [June 16, 2023, 1:02pm UTC](https://community.hubspot.com/t/multiple-replaces-on-a-richtext/83577/1 "2023-06-16T13:02:50Z")

</div>

So i have a richtext module in my template now i want to work with multiple variables that can be used in the text liks

[score] [location]

now i do a replace on the value for the score, but when i want to do also one for location. it doesn’t work.

`{{ module.heading_content | replace('[score]', review.globalScore) | replace('[location]', review.location) }}`

any idea how to fix this or another solution to this ?

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [June 16, 2023, 11:28pm UTC](https://community.hubspot.com/t/multiple-replaces-on-a-richtext/83577/2 "2023-06-16T23:28:03Z")

</div>

Hi, @Elty 👋 Welcome to our community! Thanks for including your code example. I have a few basic troubleshooting steps that will hopefully give our community members more details.

- Ensure that the `review` object has properties `globalScore` and `location` and they are not null or undefined. You could debug this by checking the values of these properties before the replace function is called
- There might be leading or trailing spaces in your placeholders. Make sure that ‘[score]’ in your content doesn’t have spaces like ‘[score]’. The same applies to ‘[location]’
- The replace function is case-sensitive. Make sure the casing of your placeholders in the content matches with the ones in the replace function

If you’ve checked all of the above and the issue persists, please share more details about your `review` object and the content you are trying to replace.

Thank you! — Jaycee

---

<div class="post-metadata">

**Author:** ![Elty](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/elty/32/58580_2.png) [@Elty](https://community.hubspot.com/u/Elty)\
**Post date:** [June 18, 2023, 6:46pm UTC](https://community.hubspot.com/t/multiple-replaces-on-a-richtext/83577/3 "2023-06-18T18:46:39Z")

</div>

Hey Jaycee, thanks for responding.

Sadly enough these things are checked. But the problem still excists.

Do you have an idea if it is possible to do 2 replace macro’s at 1 time?
