# Batch processing to search and replace in all posts

**URL:** https://meta.discourse.org/t/batch-processing-to-search-and-replace-in-all-posts/33621
**Category:** Development
**Tags:** rest-api
**Created:** [September 22, 2015, 11:56pm UTC](https://meta.discourse.org/t/batch-processing-to-search-and-replace-in-all-posts/33621 "2015-09-22T23:56:03Z")
**Posts on this page:** 1
**Showing post:** 5

<div class="post-metadata">

### Author: ![dandv](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dandv/32/169779_2.png) [@dandv](https://meta.discourse.org/u/dandv)
#### Post date: [October 3, 2015, 1:20am UTC](https://meta.discourse.org/t/batch-processing-to-search-and-replace-in-all-posts/33621/5 "2015-10-03T01:20:57Z")

</div>

Authors of import plugins (e.g. @Sander78’s Facebook import) should be able to crank/extract one out relatively quickly.

Alternatively, I’ve released a Node.js script that uses the API to do search&replace:

> [@\[Announce\] Search & replace / batch process Discourse posts](https://meta.discourse.org/t/announce-search-replace-batch-process-discourse-posts/34029):
>
> ==\> [Discourse-post-process](https://github.com/dandv/discourse-post-process) \<== I’m happy to introduce this simple but powerful Node.js script that uses the [Discourse API](https://meta.discourse.org/t/discourse-api-documentation/22706) to mass-modify Discourse posts. It essentially performs a regexp-based search & replace across all posts in a forum. After migrating a few thousand posts from MyBB to Discourse, there was various little tweaks that needed to be made (fix BBCode → Markdown conversion, re-attach attachments, fix @username mentions when the usernames have changed etc.) I’m not a Ruby coder, and…

---

_[View the full topic](https://meta.discourse.org/t/batch-processing-to-search-and-replace-in-all-posts/33621)._
