Hello,
I noticed an issue on our website with the WP Discourse plugin.
Basically after we publish a blog post and being successfully published on the Discourse forum, after let’s say 1 week if we do a slight change to the post and update it, the WP Discourse plugin tries to publish it again to the forum.
I receive then an email “Discourse Publishing Failure” saying that the embed url has already been taken.
I noticed this also when updating very old posts in Wordpress, they are popped up in the default category “News” of the Discourse forum, confusing the readers.
Is there any setting that I’m missing to avoid this?
Thanks a lot!
Could you try to re-create this issue, but before you do the change (after a week, or whatever normal time lapse there is) please check the Discourse post status in the Wordpress utility bar on the right in the post edit screen. Tell me what is shown there at the point at which you’re doing the edit, and then whether you get the behaviour you’ve just described after the edit.
Tried to update the post and the same error happened. I got also the same email about the failure.
Last error from the logs is:
[2024-05-13 18:02:53] publish.ERROR: create_post.post_error {"wp_title":"Nextcloud exhibiting at global events in May 2024","wp_author_id":"9","wp_post_id":209030,"response_message":"Embed url has already been taken","http_code":422}
Shouldn’t be there an option on the Settings page which disables the re-publishing attempt when the post is already on Discourse?
Ok, this means that your Wordpress instance isn’t letting the WP Discourse plugin save post meta fields correctly, most likely due to another plugin or theme on your site. Could you share the WP Discourse log download? That’ll include a list of plugins which could suggest a culprit.
Normally what happens is that the plugin saves the publication details after first publication. That isn’t happening on your site. That’s what we need to figure out
It changes how the plugin saves custom fields and could effect the behaviour in your case. It probably won’t fix the issue but it may give us more insight. Once you’ve enabled it, please try to recreate the same circumstances.
After we’ve tried that, we’ll then move to disabling individual plugins to see if we can isolate the issue. Do you have a staging site by any chance (i.e. a site with your themes and plugins, but without real data)?
I’m also going to add more logging into the publication logic in the plugin to help illuminate this class of issue (i.e. the storage of metadata in Wordpress after publication to Discourse). That’ll take a bit of time though and we can perform some tests like the above in the meantime.
I enabled that setting but the issue is still there.
We actually use a staging website and the funny thing is that, even if the plugins, themes and files are exactly the same, it behaves differently - meaning that after I publish a test post, it goes on Discourse correctly, and then if I come back to the same post, i don’t see the “Embed url has already been taken” error in the Discourse sidebar settings. Instead I see it like this:
There are some slight differences between the two. Probably not the cause, but it’s worth keeping your staging and production sites identical, to eliminate the possibility of that being the cause, both here and for other issues.
Aside from that, I’d recommend you checking your WP Rocket settings closely (e.g. are they actually the same between your two sites). While it works well for it’s particular purposes, WP Rocket is often the cause of issues with Wordpress plugins.
you’re right. I checked again the db_version() function inside the theme and indeed I got 5.5.5 as result. But on the “Site health” backend page I see version 10.6.16-MariaDB - same as the version the sysadmins have mentioned to me… I mean that should be also the version WP sees, right?