Problems posting to Discourse: Check that your Discourse Username is set correctly on your WordPress profile page

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.

Any help? I can’t figure out what I’m doing wrong.

2 Likes

Can you check the WP Discourse connection settings tab and see if the “You are connected to Discourse” message is displayed at the top of the page?

4 Likes

It appears that I am…

1 Like

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?

3 Likes

Yes, I am able to create a new topic/post in the Front Page Discussion category, which is where I have my WP Discourse settings set to push new posts.

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.

Let me know if this doesn’t solve the problem.

3 Likes

Thank your for your fast responses!

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.

This is what I did.

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?

publishToDiscourse

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.

2 Likes

Sorry, was away for a few days.

Will try this and let you know.

Okay…I unchecked the “use full post content” box in WP Discourse settings and I received the same error when publishing a new post.