# ניקוי תגיות html בכל הפוסטים לאחר המעבר?

**URL:** <https://meta.discourse.org/t/clean-up-html-tags-in-all-posts-after-migration/172094>\
**Category:** Migration\
**Tags:** flarum\
**Created:** [3 בדצמבר,‏ 2020,‏ 10:28am UTC](https://meta.discourse.org/t/clean-up-html-tags-in-all-posts-after-migration/172094 "2020-12-03T10:28:58Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![neounix](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neounix/32/215617_2.png) [@neounix](https://meta.discourse.org/u/neounix)\
**Post date:** [22 בדצמבר,‏ 2020,‏ 2:33am UTC](https://meta.discourse.org/t/clean-up-html-tags-in-all-posts-after-migration/172094/12 "2020-12-22T02:33:05Z")

</div>

> [@koen360](#):
>
> Should be fine then right using the remap?

FWIW @koen360

When we migrated our forum we had countless of these bbcode and tag issues from nearly two decades of forum posts.

We did not use the rake remap function for these and, in all cases, we used the technique that @pfaffman outlines in his code snippet:

> [@pfaffman](#):
>
> ```plaintext
> posts=Post.where("raw like '%Sent from%using Tapatalk'")
> 
> posts.each do |post|
> post.raw.gsub!(/^Sent from my.+?using Tapatalk$/,"")
> post.save
> post.rebake!
> end
> 
> ```

This code snippet above using `gsub()` summarizes one of the best ways to clean up the raw posts after (or even better, during) migration.

> Make sure you test your REGEX expressions BEFORE you actually implement them on the DB and have a full backup before you do operations like this directly on your DB.

---

_[View the full topic](https://meta.discourse.org/t/clean-up-html-tags-in-all-posts-after-migration/172094)._
