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

AI-generated summary

Aymane_Shuichi reported an issue with sharing links from their RTL language website on Facebook, where the title of the topic does not appear. simon suggested that the problem might be related to locale settings rather than RTL languages, and shared their own experience with a similar issue caused by a plugin. They also recommended using Facebook’s debug tool to test posts.

Aymane_Shuichi discovered that the difference between their site and Discourse lies in the og:url meta tag, which specifies the URL for Facebook to scrape. Discourse’s og:url includes the topic title, while their site’s og:url does not. They are seeking a way to make the meta tag dynamic.

simon confirmed that the og:url structure might be the cause of the problem, but is unsure how to make it dynamic.

Hi,

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 https://developers.facebook.com/tools/debug/og/object/ to see what information Facebook is getting.

「いいね!」 1

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="http://www.manga-sekai.com/" />
When Discourse has this :
<meta property="og:url" content="https://meta.discourse.org/t/sharing-links-on-facebook-doesnt-get-the-title-of-topic-in-rtl-languages/35852/2" />

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 http://forum.testeleven.com/t/topic/30. It leaves the title out of the url but that’s ok.

「いいね!」 1