LinkedIn 403 Forbidden error and intermittent opengraph data

Hi all,

I’m writing to ask for help with an issue we’ve been having for months.

Intermittently, when we add our websites URLs to LinkedIn, we get an error that says “Cannot display preview. You can post as is, or try another link.” We also see this problem when embedding the links in a LinkedIn newsletter.

This LI display issue is intermittent in the sense that some URLs work fine, while others don’t work at all.

One suggestion is that LinkedIn has cached a bad version of the page (and its opengraph data), and the solution is to run the URL through LinkedIn’s Post Inspector (https://www.linkedin.com/post-inspector/) as this is supposed to remove the old version from the LI cache and add a new one (useful if the page has changed).

When I run any site URL (except for our homepage – http://sustainablefuturenews.com) through the inspector, it comes back as 403 forbidden – it’s worth noting that this even includes the URL’s that DO work on LinkedIn.

Here is an example of a URL that doesn’t work – https://sustainablefuturenews.com/greenwashing/over-half-of-consumers-would-boycott-companies-caught-greenwashing

We’ve had a similar issue in the past with crawlers such as Ahref, which, we believe, were blocked by Cloudflare’s protection.

To get a handle on the problem, I ran the above subdomain a network response tester -(https://httpstatus.io/). I got the correct and working 200 result for every user agent, except LinkedInBot, which came back with:

Status code 403, with the response header:

Date Fri, 29 Sep 2023 09:20:26 GMT

Content-Type text/html

Transfer-Encoding chunked

Connection close

Cache-Control private, no-cache, no-store, must-revalidate, max-age=0

Pragma no-cache

Cf-Cache-Status DYNAMIC

Nel {“success_fraction”:0,“report_to”:”cf-nel”,“max_age”:604800}

Server cloudflare

Cf-Ray 80e326763d24bb37-FRA

Alt-Svc h3=":443”; ma=86400

Because all other user agents work, it makes me think the issue is with LinkedIn. But I was hoping someone here might have an idea as to whether Cloudflare could be blocking access for the LinkedIn bot to collect the opengraph data for the link, which is causing the problem. I only have a medium level of knowledge in terms of networking.

Happy to send over any other information you might need! Thank you for your help!

All the best,

James

Hi,

Please see this answer to a similar question and follow its suggestions to identify what may blocking your requests. (Where it says 1. Try to upload an image you should of course make the request through Linkedin.)

Hi cbrandt,

Thanks for sharing those steps – no hits in the events log, so I presume that means it’s not Cloudflare that’s causing the problem. Is there anywhere I can see all connections passing through Cloudflare (not just the ones that were blocked by the firewall)?

I’ll also speak with my hosting provider (they’ve already said it should be fine on their end) to see if I can figure out the next steps.

You can use a recently added tool called Trace (beta). It’s available on your Dashboard after you select your account (but not a zone). You’ll be able to provide the URL and certain conditions (cookie, headers etc.) and see which rules are triggered in the way to the origin.