# Wordpress blog, comments and manually copying it to Discourse

**URL:** https://meta.discourse.org/t/wordpress-blog-comments-and-manually-copying-it-to-discourse/68801
**Category:** WordPress
**Created:** [August 25, 2017, 10:30pm UTC](https://meta.discourse.org/t/wordpress-blog-comments-and-manually-copying-it-to-discourse/68801 "2017-08-25T22:30:08Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![Quintin\_Par](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/quintin_par/32/120500_2.png) [@Quintin\_Par](https://meta.discourse.org/u/Quintin_Par)
#### Post date: [August 25, 2017, 10:30pm UTC](https://meta.discourse.org/t/wordpress-blog-comments-and-manually-copying-it-to-discourse/68801/1 "2017-08-25T22:30:09Z")

</div>

I am setting up a discourse forum for my blog and as [I understand](https://meta.discourse.org/t/discourse-wordpress-plugin-version-0-6-6/31585/13), there is no way to ~~sync~~ migrate **existing** wordpress comments to discourse topics and as its replies.  
Since that is the case, I was thinking of doing this task manually.  
i.e.

1. Create A discourse topic backdating it to the creation of the blog post
2. Copy over each of the blog post’s comments to the topic, creating/migrating a user account in the process

I have around 2,000 comments.

**Question:**

1. Is this a good workflow? Potential flaws?
2. Can I go an embedded an old blog post and the new back-dates forum top created? Does this mean I’ll have to use the [WP-discourse](https://meta.discourse.org/t/discourse-and-wordpress-integration/) plugin and the [WP-discourse-JavaScript](https://meta.discourse.org/t/embedding-discourse-comments-via-javascript/) plugin together? Is it even possible? Will this conflict?
3. Do you have a better approach?

---

<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: [August 26, 2017, 2:47am UTC](https://meta.discourse.org/t/wordpress-blog-comments-and-manually-copying-it-to-discourse/68801/2 "2017-08-26T02:47:00Z")

</div>

> [@Quintin\_Par](#):
>
> as I understand, there is no way to sync migrate existing wordpress comments to discourse topics

It’s fairly straightforward to modify the [WP Discourse](https://github.com/discourse/wp-discourse) plugin so that it will publishing existing WordPress comments to Discourse when a post is first published from WordPress to Discourse. A couple of hooks could be added to the plugin so that the modification required for doing this could be added through a separate plugin. The biggest issue with doing it this way is that the posts will be published under the username of an admin user.

---

<div class="post-metadata">

### Author: ![Quintin\_Par](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/quintin_par/32/120500_2.png) [@Quintin\_Par](https://meta.discourse.org/u/Quintin_Par)
#### Post date: [August 26, 2017, 2:15pm UTC](https://meta.discourse.org/t/wordpress-blog-comments-and-manually-copying-it-to-discourse/68801/3 "2017-08-26T14:15:26Z")

</div>

Sorry, I miscommunicated. It should have been migration. i.e port over all the exists comments, which I reckon is around 2000+  
I am no good with programming, more a business owner and hence the reason to opt manual migration.

> [@simon](#):
>
> when a post is first published

The post was already published. Some of them years back. Does that mean the logic you mentioned applies? I am thinking the logic you mentioned applies for “sync” – whenever a new post is published on WP post migration to discourse.

> [@simon](#):
>
> modification required for doing this could be added through a separate plugin.

Is there some implementation out there I can take a look under the hood?

---

<div class="post-metadata">

### Author: ![Mittineague](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mittineague/32/114259_2.png) [@Mittineague](https://meta.discourse.org/u/Mittineague)
#### Post date: [August 26, 2017, 6:08pm UTC](https://meta.discourse.org/t/wordpress-blog-comments-and-manually-copying-it-to-discourse/68801/4 "2017-08-26T18:08:33Z")

</div>

There are scripts for migrating other forums to Discourse, but AFAIK there are none for migrating a WordPress blog to Discourse.

Not that it couldn’t be done. Most if not all of the INSERT stuff could be picked from the existing scripts. The WordPress tables would need to be analyzed to determine what the SELECTs would need to be.

---

<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: [August 26, 2017, 6:39pm UTC](https://meta.discourse.org/t/wordpress-blog-comments-and-manually-copying-it-to-discourse/68801/5 "2017-08-26T18:39:58Z")

</div>

> [@Quintin\_Par](#):
>
> The post was already published.

If you install the [WP Discourse](https://github.com/discourse/wp-discourse) plugin you can publish old WordPress posts to Discourse.

> [@Quintin\_Par](#):
>
> Is there some implementation out there I can take a look under the hood?

I don’t think so. It’s something that I’ve only tried in my development environment. It would take a few hours of work to get it into a state where I could share it. I’m not sure if it would be a good solution for what you’re trying to do. The problem is that the posts (comments) are published under the username of the system user. It’s possible to append some text to the post to indicate which user create the post, but if in the future someone replied to one of those posts, the creator of the post wouldn’t get a notification for it.

One thing you can do with the [WP Discourse](https://github.com/discourse/wp-discourse) plugin out of the box is display old WordPress comments on your WordPress site underneath the comments that are pulled from Discourse.

---

<div class="post-metadata">

### Author: ![iva](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/iva/32/120762_2.png) [@iva](https://meta.discourse.org/u/iva)
#### Post date: [August 27, 2017, 6:00am UTC](https://meta.discourse.org/t/wordpress-blog-comments-and-manually-copying-it-to-discourse/68801/6 "2017-08-27T06:00:15Z")

</div>

There is an existing plugin to migrate Wordpress comments to bbPress and then there is a migration script from bbPress to Discourse. That’s what I did.

---

<div class="post-metadata">

### Author: ![Quintin\_Par](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/quintin_par/32/120500_2.png) [@Quintin\_Par](https://meta.discourse.org/u/Quintin_Par)
#### Post date: [August 27, 2017, 11:45pm UTC](https://meta.discourse.org/t/wordpress-blog-comments-and-manually-copying-it-to-discourse/68801/7 "2017-08-27T23:45:50Z")

</div>

Hahaha. That’s twisted but thank you.

---

<div class="post-metadata">

### Author: ![Quintin\_Par](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/quintin_par/32/120500_2.png) [@Quintin\_Par](https://meta.discourse.org/u/Quintin_Par)
#### Post date: [November 5, 2017, 10:12pm UTC](https://meta.discourse.org/t/wordpress-blog-comments-and-manually-copying-it-to-discourse/68801/8 "2017-11-05T22:12:58Z")

</div>

> [@simon](#):
>
> If you install the [WP Discourse](https://github.com/discourse/wp-discourse) plugin you can publish old WordPress posts to Discourse.

How do I publish old wordpress posts to discourse? I can do this with new posts. I tried testing this by writing a comment on an old wordpress post (posts that we created prior to link to discourse) but the corresponding topic and comment did not get created on discourse.

What am I doing wrong?

---

<div class="post-metadata">

### Author: ![Quintin\_Par](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/quintin_par/32/120500_2.png) [@Quintin\_Par](https://meta.discourse.org/u/Quintin_Par)
#### Post date: [November 5, 2017, 10:14pm UTC](https://meta.discourse.org/t/wordpress-blog-comments-and-manually-copying-it-to-discourse/68801/9 "2017-11-05T22:14:49Z")

</div>

If go this route, will the wordpress posts be linked to the discourse topics so that they show up as comments under a wordpress posts?

---

<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: [November 6, 2017, 2:25am UTC](https://meta.discourse.org/t/wordpress-blog-comments-and-manually-copying-it-to-discourse/68801/10 "2017-11-06T02:25:25Z")

</div>

You should be able to publish old posts without any problem. Do it the same way you publish new posts - go to the post’s edit screen, select the Publish to Discourse checkbox, and then click the Update button. WordPress comments are not published on Discourse, only the post is published. That’s why some sort of migration will be required if we want to get existing WordPress comments onto Discourse.

---

<div class="post-metadata">

### Author: ![Quintin\_Par](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/quintin_par/32/120500_2.png) [@Quintin\_Par](https://meta.discourse.org/u/Quintin_Par)
#### Post date: [November 11, 2017, 7:10pm UTC](https://meta.discourse.org/t/wordpress-blog-comments-and-manually-copying-it-to-discourse/68801/11 "2017-11-11T19:10:10Z")

</div>

Hi @iva,

How did you associate the discourse topics to wordpress blog posts after the migration?

 ![image](https://global.discourse-cdn.com/meta/original/3X/5/c/5ca07d6346f9a859dd6e8c50538a683f745dcf9c.png)

Also, did you follow this?

> [@Migrate a phpBB3 forum to Discourse](https://meta.discourse.org/t/importing-from-phpbb3/30810):
>
> So, you discovered Discourse and want to know how to migrate from your existing phpBB3 forum? Great! Then keep on reading. This guide will show you how to use the [phpBB3 import script](https://github.com/discourse/discourse/blob/main/script/import_scripts/phpbb3.rb) for importing from phpBB 3.0 up to 3.3. What data can be imported? Users Avatars (optional) Anonymous users (either as user “system” or as suspended users) Password hashes, which can be used with the [migratepassword plugin](https://github.com/communiteq/discourse-migratepassword) (optional) User profile data (birth date, website, location, custom fields, etc.) G…
