# How do I change the legacy CDN URLs of images in posts?

**URL:** https://meta.discourse.org/t/how-do-i-change-the-legacy-cdn-urls-of-images-in-posts/97518
**Category:** Support
**Created:** [September 19, 2018, 4:09am UTC](https://meta.discourse.org/t/how-do-i-change-the-legacy-cdn-urls-of-images-in-posts/97518 "2018-09-19T04:09:39Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)
#### Post date: [September 19, 2018, 6:11am UTC](https://meta.discourse.org/t/how-do-i-change-the-legacy-cdn-urls-of-images-in-posts/97518/2 "2018-09-19T06:11:08Z")

</div>

It should (at very least) begin with changing the Discourse CDN URL in your yml file and then rebuilding discourse.

If You only have to replace links in database, there is a rake find & replace task there just for this purpose.  
Documentation here:

> [@Replace a string in all posts](https://meta.discourse.org/t/replace-a-string-in-all-posts/48729):
>
> bookmark This guide explains how to replace a string in all posts within a Discourse instance. person_raising_hand Required user level: System Administrator warning Console Access Required Want to replace a string in all the posts on a site? Let’s get started! warning WARNING: We strongly recommend you take a full backup before proceeding, and make sure your string replacement is specific enough to affect only the places you want it to. If this string replacement goes wrong, every…

---

_[View the full topic](https://meta.discourse.org/t/how-do-i-change-the-legacy-cdn-urls-of-images-in-posts/97518)._
