Original date and time for WordPress posts published to Discourse

Is it possible to use the original date and time of WordPress posts which are published to Discourse afterwards, like when migrating to Discourse and bringing all the missing blog posts into the Discourse forum?

At the moment the current date and time is used which causes that all new crossposts to Discourse need to be edited for the original date and time.

1 Like

Hey there @Roi, it’s not possible to do that using the WP Discourse plugin. It sounds like you’re doing a migration? The best way to handle a migration is by using a migration script on your server. That’s the way to get the bulk metadata outcomes you’re looking for.

1 Like

Thank you for your answer. Too bad that there is no switch for that…

Well, the migration (from phpBB3 to Discourse) is done, but I still want to dock Discourse to the WordPress website and I would love to have all the old blog posts into Discourse as well. So, yes, you can say so.

It’s too many blog posts to be happy to do this by hand. But too less to write an script. I also searched for a script, but did not stumble upon one. So I will end up doing this by hand I guess…

Re-reading this I’m a little confused as to what you’re trying to achieve here.

Do you mean that you’re manually changing the date and time of the posts in Discourse itself?

Yes correct.

PS: In my eyes, as topics/posts get synced from WordPress to Discourse, the date/time should be the same. No matter if I sync the post when creating it or when syncing it later.

Are you concerned that you’ll end up with a lot of new topics in “latest” when you perform your migration?

I am resetting the move to top / bump date (no idea how it is called in English), too. So even one click more. :wink:

But I noticed that the migrated blog posts are shown in the personal user activity history at the top. Even if the date is older that the “real” posts the user made.

This is why you need to do these kind of things with a migration script and why it wouldn’t make sense for the WP Discourse plugin to let you force the post created_at date to match the Wordpress post date.

If I added that as an option people would attempt to do the kind of operation you’re doing, find it doesn’t work (because of things like the bump date) and then come here to ask for support with what is really a migration :slight_smile: I say this in kindness, as I do understand what you’re trying to do.

The solution is to handle it properly, with a migration script. The plugin is not designed for bulk operations. Trying to make it work for bulk operations will always be more trouble than its worth.

For the normal use of the plugin, the Wordpress date does match the Discourse date, because the publication to Discourse occurs at the time of publication of the original post.

1 Like

I do understand. It’s theory and the real doing. It is not that many posts that a migration script would make sense - if there is not already one available. For me it is far more time to work myself into all of this than doing this by hand. And as this forum is just a fun project with no money involved, I cannot invest in getting help.

Yeah, understood. And these few seconds, if seconds and not milliseconds, do not make a difference.

1 Like