Publish error on WP-Discourse

Hi!

For some reason, WP featured image won’t be published anymore on the Discourse posts.
I have a featured_link.post_error that returns a 403 error.

Here’s full error message in WP-Discourse:

[2021-07-16 22:02:50] publish.ERROR: featured_link.post_error {"wp_title":"Roule Ton Unifest' (Métabief,  Jura)","wp_author_id":"17","wp_post_id":159075,"discourse_post_id":"203291","response_message":"Forbidden","http_code":403} 

Any idea how I can fix this?

Hey @Canapin,

The featured image in Wordpress and the featured link in Discourse are different things.

The featured link is a link that’s applied to Discourse topics, which appears below the topic title in a topic, and next to the title in a topic list. You can set the featured link in posts published from Wordpress using the Add Featured Links publishing setting. To see this working on the latest code of both WP Discourse and Discourse, see

You can add the featured image of a Wordpress post to the full text of a post published on Discourse following the steps outlined here.

Your log error

It looks like the error you’re getting there for the featured link request is an authorisation error. The code 403 and the message “Forbidden” (which comes from Discourse itself, not WP Discourse) is telling us that the user who you’ve set in your WP Discourse connection settings doesn’t have permission to use the Topic update endpoint (which is used to update a topic to add the featured link).

I would first try refreshing the API token (set it as a “Global Key” when you generate it in Discourse) you’re using in WP Discourse.

1 Like

Thanks for the detailed answer and the WP Discourse template customization link, I used some code from here and now featured images work again, among other things that were also broken. Everything was working well less than a week ago so I guess my code was incompatible with a recent update of WP Discourse or something like that.

However, there’s still the featured link error in WP Discourse logs though posts are correctly updated. :thinking:
Despite this logged error, everything seems to be working fine.