Disable posting wordpress articles to Discourse when they're updated

Howdy, the plugin mostly works great, thanks. One issue is that I intentionally have WP articles that are old and never posted to Discourse. When any edit is made to those old WP articles, like fixing a typo, a new post is made to Discourse as if that WP article was brand new. That notifies our users about old content they don’t want to see.

Is there a way to disable this behaviour? Thanks.

Hey Sam,

The plugin gives you various options for deciding when content in Wordpress is posted to Discourse which also cover the publication of old posts. Firstly, check out the “Publishing” settings in WP Discourse which will set the default publication options. Then also check out the WP Discourse sidebar in the post itself when it’s being created or edited.

For more background on both, see

Hi, chiming in because I’m running into the same behavior as @samtuke and I can’t find a way around it.

If an editor corrects something, like a typo, in an old Wordpress article that wasn’t published on Discourse before, it gets published automatically as a new topic. I’d like to prevent this, and only publish newly written posts.

I guest I could add a hacky hook to check if post_ID > $lower_treshold_of_post_ID_I_want_to_publish, but perhaps there’s a better solution.

Thanks,

1 Like

Hey @ajolo2ky, could you share the current publish settings you have? Ideally, if you could share the “meta” file from the log viewer.

Sure,

These are the Publish settings:

This is what I see in the logs, after an editor corrected something in a 2023 (old – I don’t want it to be posted on Discourse) post:

[2025-03-12 14:33:09] publish.INFO: create_post.post_success {"wp_title":"title","wp_author_id":"1","wp_post_id":7} 
[2025-03-12 14:33:09] publish.INFO: create_post.body_valid {"wp_title":"title","wp_author_id":"1","wp_post_id":7} 
[2025-03-12 14:33:09] publish.INFO: create_post.after_publish {"post_id":7,"remote_post_type":"create_post","discourse_post_id":"2","discourse_topic_id":"9","discourse_permalink":"https://discourse.mydomain.com/t/title/9"}

I cannot publicly share the meta contents, but happy to share them privately, if that helps.
Thanks!

Thanks for sharing that. The reason existing articles are being published when they’re edited is probably because you have “Auto Publish” enabled, which means the “Publish post to Discourse” checkbox will be auto-checked in the editor.

Are you using the “classic” Wordpress editor:

or the new (Gutenberg) editor?

Yes, that’s the reason, but the behavior I’d expect was to publish new articles, not edited ones. We are using Gutenberg.

I know I can disable the default behavior, and then manually selecting new posts to be published on Discourse, but I was hoping for a better resolution :slight_smile:

All I know the logic where

  • new articles will be published to Discourse
  • already published to Discourse should be updated when edited
  • old articles should not publish to Discourse when edited

sounds a bit confusing.

Without no better understanding about coding than one hello worls test using Virtual Basic, I could guess it can be done comparing status of article against Discourse status, but such actions has tendency to slowing down admin side. Or that would be the situation at some time in pass :man_shrugging:

Thinking about settings that would be very confusing setup.

@ajolo2ky I understand why you might expect it to work that way, indeed this is something that has niggled at me for some time. The reason it hasn’t worked that way in the past is due to the complexities of supporting auto-publish across both Gutenberg and Classic editors. Many folks still use the Classic editor.

I looked at a possible improvement to the Gutenberg behaviour this morning and am hoping to get an update in the next version. In the meantime just uncheck “Publish to Discourse” or disable Auto Publish if you don’t want posts to be published in that scenario.

I’ll update you here if/when the next version is released with the updated behaviour. Hopefully in about a week from now.

1 Like

Hi Angus, thank you very much. Following up to see if you had any updates on this.

Thanks!