After updating my WP install of Discourse to the latest version, I can no longer publish posts from my front page to Discourse. Instead, in the Discourse pane inside WP it says:
“Your post could not be published to Discourse. Check that your Discourse Username is set correctly on your WordPress profile page.”
I checked my Discourse Username in the WP profile page and it matches my Username in Discourse (I am an admin). It also matches the Publishing Username in the Discourse settings in WP “Connecting with Discourse”.
Here’s pics of all the places I can think my Username should match up and it does but the error persists.
Does your user have permission to create topics in the Discourse category you are posting to? Are you able to create a topic in that category through the Discourse user interface?
The error that is being returned from Discourse is a Forbidden error. For some reason the API Key and Publishing Username that you have set on the plugin’s Connections options tab does not have permission to publish a post under your username.
Could you try going to your /admin/api/keys page and creating an All Users API Key? If you already have an All Users API key, you can use that instead of creating a new key. Copy that key to the WP Discourse Publishing Username setting, and then change the Publishing Username from “Neumannium” to “system”. Save the Connection settings and make sure you are still seeing the Discourse connection notice. Then try publishing a new post.
Ok, so I regenerated a new API key (All Users). I copied that into the WP Discourse setting and changed my Username to system. I saved and it and then wrote a new post. I received the same error and it didn’t make its way to the forums.
What I meant was change the username that is set as the Publishing Username on the WP Discourse connection options tab to “system”. This is assuming that you have not changed the name of the system user on your Discourse site.
If you have done this, and it’s still not working for you, can you try removing your Discourse username from the setting on your WordPress profile page? After doing that, see if you are able to publish a post. If everything is working as expected, the post will be published by the system user.
So, I just removed my username from the WP profile page. It is blank. It is ‘system’ on the WP Discourse settings.
I just tried to publish a new post and the same error popped up, so it published to my front page and not to Discourse. I did notice that the checkbox for publishing to Discourse looks different than it used to. Or maybe I just never noticed it? Anyway, it looks like this? A clue or nothing?
Yes, I see that too. WordPress updated their admin styles.
I’m not sure what the issue could be. The one thing that’s clear is that you are getting a 403 response from Discourse when you try to publish a post. The message you are seeing about the username is a guess about what the cause of the issue is, but it doesn’t seem to be correct for your case.
Can you try unchecking the WP Discourse “Use Full Post Content” site setting and see if you are able to publish an excerpt from WordPress to Discourse? That setting is found on the plugin’s Publishing settings tab.