# Effect of changing the WordPress site URL

**URL:** <https://meta.discourse.org/t/effect-of-changing-the-wordpress-site-url/70275>\
**Category:** WordPress\
**Created:** [2017年九月18日 14:05 UTC](https://meta.discourse.org/t/effect-of-changing-the-wordpress-site-url/70275 "2017-09-18T14:05:20Z")\
**Posts on this page:** 1\
**Showing post:** 24

<div class="post-metadata">

**Author:** ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)\
**Post date:** [2017年九月22日 18:13 UTC](https://meta.discourse.org/t/effect-of-changing-the-wordpress-site-url/70275/24 "2017-09-22T18:13:05Z")

</div>

Thanks! The TopicEmbed embed\_urls can’t be updated from the WordPress end, so if they need to be changed, you guys will have to do it. Ideally, Discourse would just follow the redirects to fetch the WordPress post’s content. It might be worth checking that the redirects are working.

If the URLs need to be rewritten, something like this can do it:

```plaintext
TopicEmbed.all.each do |embed|
  if embed.embed_url.starts_with? 'http://olddomain.com'
    embed.embed_url = embed.embed_url.sub 'http://olddomain.com', 'http://newdomain.com'
    embed.save
  end
end

```

---

_[View the full topic](https://meta.discourse.org/t/effect-of-changing-the-wordpress-site-url/70275)._
