Social media previews no longer work

Platform: website

Browser, if a website issue: n/a

URLs (aka web addresses) of any relevant observations or pages: any page with useful opengraph tags (e.g. individual observations)

Description of problem:

Recently, social media previews started breaking. This can be demonstrated with curl as follows.

$ curl -sL 'https://www.inaturalist.org/observations/346061535' | grep 'og:image'

What is expected here is that the meta tags for the observation that are used by social media platforms to generate a preview card for the page should be included in the page, e.g.

<meta content="https://inaturalist-open-data.s3.amazonaws.com/photos/630757989/large.jpg" property="og:image">

What happens instead is a challenge page is shown. No social media preview (Discord, etc.) will be shown as a result when an iNaturalist page is linked to. Those platforms are non-interactive like this curl request that simulates the issue, and therefore can’t answer the challenge.

update 2026-04-25: The broader issue is solved for other social media platforms like Facebook, BlueSky, and WhatsApp, but social media links on Discord remain broken. See the link to that issue near the end of this thread.

Thank you for reporting this issue.

It should be fixed now, but it could take some time to roll out everywhere (some social media tools may have cached the error and will only retry in a few minutes/hours/days)

I’m seeing failure to preview images for brand new URLs that Discord would not have seen before still happening today.

For example here’s one that was posted less than an hour ago for an observation that was only just made a short while ago. Surely Discord couldn’t be hanging on to old results:

https://www.inaturalist.org/observations/346573881

Maybe the fix didn’t take? (yet?)

This is what I get back from curl (manually rewrapped and <script> and <style> stripped out):

$ curl -sL https://www.inaturalist.org/observations/346573881
<!DOCTYPE html><html lang="en-US">
<head><title>Just a moment...</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<meta name="robots" content="noindex,nofollow">
<meta name="viewport" content="width=device-width,initial-scale=1">
…
<meta http-equiv="refresh" content="360"></head><body><div class="main-wrapper" role="main">
<div class="main-content">
  <noscript>
    <div class="h2"><span id="challenge-error-text">Enable JavaScript and cookies to continue</span>
    </div>
</noscript></div></div>
…
</body></html>

So maybe that’s a case that wasn’t considered in the fix? Social media previewers aren’t going to have Javascript and cookies enabled, I bet.

I looked for code in the iNaturalist github repo related to the fix that was supposedly implemented and couldn’t find any. Perhaps the fix was a configuration change only for Cloudfront, not a code change?

In any case, is there anything else I can do to help move this forward? It has been two weeks since the issue was reported as fixed, but I quickly found that it isn’t actually fixed, at least not for Discord image previews. I have a workaround in place for Dronefly bot, but it only addresses a fraction of the problem for a fraction of iNaturalist users:

  • Only some users benefit: there are many other people who use iNaturalist who use Discord, but not our bot
  • To stay within iNat rate limits, Dronefly bot only previews a single observation link per message, and that limit also applies to our workaround. Before this broke, Discord would show preview images for several observation links in the same message, something the bot is too constrained by API limits to be able to handle on its own.
  • There is a potential impact on social media platforms other than Discord. But Discord is the only one I use, so I don’t know how far-reaching this problem is.

I’d like to add another URL that doesn’t work that is impacting us negatively on iNaturalist Discord and probably is a problem for other social media platforms as well. Profile links are no longer previewed by the Discord platform due to the new CloudFlare challenge.

Formerly (command typed in 2020 so this is an older version of my profile) a preview would look like this:

Now, no preview is generated.

Any update on at least whether this is in the queue to be worked on?

In an effort to help narrow down the problem with link previews still going missing on Discord, I started drafts of posts on these two other platforms this morning:

  • Facebook
  • Bluesky

Both platforms previewed my profile link in the draft. Discord, on the other hand, does not preview the link. So the problem does appear to be partially solved. Links preview correctly on these popular social media platforms. Perhaps the solution is for specific platforms only?

If that’s the case, I propose that iNaturalist could add a CloudFlare rule that checks the User-Agent string and/or verifies the access against known Discordbot IP ranges in order to whitelist those accesses, solving issue for Discord. Here’s a page that might help with that: https://plainsignal.com/agents/discordbot

I have marked this issue “solved” again, as the changes that iNaturalist made for some social media platforms did in fact help. However, Discord remains unsolved, so I created a separate bug report for that: https://forum.inaturalist.org/t/link-previews-no-longer-being-generated-on-discord/78161