Sharing links on Facebook doesn't get the title of topic in RTL languages


I’m trying to share links from here, on Facebook. But I don’t get the correct data to show up on Facebook before posting, unlike links from this very forum.

Is this problem related to this ?

I don’t think the problem is RTL. It might have something to do with the locale though. I just tried sharing a post to Facebook from my forum and found that it didn’t work. The problem for me was that I was using a plugin that tries to read the Accept-Language header from the request. It seems that when Facebook scrapes the data they don’t set the Accept-Language request header. This was causing an error with the request. When I disabled the plugin Facebook was able to scrape the data again.

I then tried setting my forum’s locale to ‘ar’ and made a post in Arabic (I don’t speak Arabic so it was just random letters and a picture :slight_smile: ) Facebook was able to scrape the data without any problem.

You can test posts here to see what information Facebook is getting.

1 Like

Ok the only difference I’m seeing between my site & Discourse is the following:

Inside a topic page I have :
<meta property="og:url" content="" />
When Discourse has this :
<meta property="og:url" content="" />

og:url tells Facebook to scrap exactly this url. How do I get the meta dynamic ? Any idea?

I have no idea, but that looks like the problem. When I change my locale to ‘ar’ and make a post the url structure I get is It leaves the title out of the url but that’s ok.

1 Like