Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello, @lbdeveloper aarpmahjongg

    The issue you’re encountering with Discord previews displaying content in all languages, despite language restrictions set on your website, is likely due to the way Discord fetches and displays link previews. When Discord or other social platforms generate previews, they typically scrape the metadata of the web page, which includes elements like title, description, and image, as defined by Open Graph tags (, for example).

    Suppose the Restrict By Language feature of TranslatePress is implemented using JavaScript or CSS. In that case, it’s possible that this content is still present in the HTML and thus gets included in the metadata fetched by Discord. Social media scrapers generally do not execute JavaScript or apply CSS; they only read the raw HTML content. Therefore, if the restriction is not reflected in the HTML itself, the content will still appear in previews.

    Here are some steps you can take to address the issue:

    Check Open Graph Tags: Ensure that the Open Graph tags on your pages are set correctly for the specific language you want to display in the preview.
    Server-Side Rendering: Consider implementing server-side language restrictions so that the HTML sent to the client (and thus to Discord’s scraper) only contains the content for the specified language.
    Use a Link Preview Customization Service: Some services allow you to customize how your link will appear when shared on social media, including the language of the content displayed in the preview.

    It’s important to note that changes to the website’s metadata and server-side rendering can be complex and may require the assistance of a web developer. If you’re not comfortable making these changes yourself, it might be best to consult with a professional who can ensure that the changes are implemented correctly and without affecting other parts of your site. I hope this helps, and you find a solution that works for your needs!

    Best Regard,
    aarpmahjongg

    Hey there,

    Thanks for reaching out!

    Patrick (@patrick521 ) provided an excellent explanation of the problem and potential solutions!

    Some solutions may require a developer’s help. If you’re not comfortable making these changes yourself, consider consulting a professional to ensure everything is implemented smoothly.

    Do you have any further questions about the solutions or need help finding a developer? We’re happy to assist in any way we can.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Site previews show all languages’ is closed to new replies.