# Watched words - replace link/url works in test but not in post

**URL:** https://meta.discourse.org/t/watched-words-replace-link-url-works-in-test-but-not-in-post/234904
**Category:** UX
**Tags:** watched-words
**Created:** [August 2, 2022, 11:23pm UTC](https://meta.discourse.org/t/watched-words-replace-link-url-works-in-test-but-not-in-post/234904 "2022-08-02T23:23:12Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![janbolmeson](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/janbolmeson/32/192162_2.png) [@janbolmeson](https://meta.discourse.org/u/janbolmeson)
#### Post date: [August 2, 2022, 11:23pm UTC](https://meta.discourse.org/t/watched-words-replace-link-url-works-in-test-but-not-in-post/234904/1 "2022-08-02T23:23:13Z")

</div>

Maybe this is me doing something wrong, but I don’t seem to get watched word replace (or link) work with urls.

To recreate:

1. In watched\_words section I add this to word: `https://example.com` to look for
2. And this to replace with: `https://domain.com/?url=https://example.com`

That is:  
 ![image](https://global.discourse-cdn.com/meta/original/4X/4/d/8/4d80f65df43f98e6e8baa1ff0b9dc7cb42b73022.png)

When I use the Test-button, it works:

 ![image](https://global.discourse-cdn.com/meta/original/4X/9/a/b/9abeb6b0dc8730ec2537f0955206e7c9a588b106.png)

But when I test the same in a post, it doesn’t match.

 ![image](https://global.discourse-cdn.com/meta/original/4X/9/2/1/921a9fcb5400398fabcb992a5b3e37499a45893b.png)

---

<div class="post-metadata">

### Author: ![SaraDev](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/saradev/32/335139_2.png) [@SaraDev](https://meta.discourse.org/u/SaraDev)
#### Post date: [August 10, 2022, 6:23pm UTC](https://meta.discourse.org/t/watched-words-replace-link-url-works-in-test-but-not-in-post/234904/3 "2022-08-10T18:23:33Z")

</div>

Hi Jan,

Remapping links through the use of watched words is not recommended, and can sometimes cause more trouble than intended, so we’ve disabled the ability to do so using Watched Words → Replace settings, and links will not be remapped in topics or posts regardless of watched word settings.

if you’re looking to remap links on your site there’s a couple other options we recommend for this.

The first option would be to still use Watched Words, but to add the links or urls to the “Require Approval” section instead of “Replace”. This would cause posts containing the links to be remapped to appear within the review queue, which you could then go through and update the links manually through the review queue.

Alternatively, there’s a `rake posts:remap["find","replace"]` command that you can run to remap or replace links (or specific text) on your site across all posts. For reference, we have more information about the `remap` command available here: [Replace a string in all posts](https://meta.discourse.org/t/replace-a-string-in-all-posts/48729)

With that in mind, I think the trouble here is that the Watched Words Test button seems to show that links/URLs will be remapped in posts, which is not the intended use case.

The test window should be true to reality, so perhaps we could make some small changes to the test window UI to indicate that links/urls will be _NOT_ be remapped?

---

<div class="post-metadata">

### Author: ![janbolmeson](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/janbolmeson/32/192162_2.png) [@janbolmeson](https://meta.discourse.org/u/janbolmeson)
#### Post date: [August 10, 2022, 7:19pm UTC](https://meta.discourse.org/t/watched-words-replace-link-url-works-in-test-but-not-in-post/234904/4 "2022-08-10T19:19:08Z")

</div>

Thank you good explanations. I understand and will solve it accordingly! 👍
