Encountered a strange problem couple of weeks ago; could not share any links from a couple of my sites to Facebook. I mean, I was able to share the links, but nothing showed up when pasting the link to the “What’s on your mind?” field. Never happened to me before.
Facebook URL debugger is a great tool for testing links because Facebook’s cache can be a real pain sometimes. But instead of even remotely partial results, I got (even when fetching new data), without any other output:
Error parsing input URL, no data was cached, or no data was scraped.
And when echoing from the URL, got:
Document returned no data
I went through literally all the first ten pages of Google and never found any solutions. This was ongoing for weeks. To save you the trouble, here’s the basic stuff that has to be right for Facebook sharing to work:
- Open Graph meta tags (og:image should be more than 200×200 px and preferably 1500×1500): og:url, og:title, og:description, etc. There are many great WordPress plugins for this, for example, wonderm00n’s and YOAST’s
- When sharing, share without last trailing slash (http://www.google.fi, not http://www.google.fi/)
- If you use WordPress SEO, disable Force rewrite titles under Titles & Metas
- Recommended to use wonderm00n’s Simple Facebook Open Graph plugin, it adds all the necessary pieces to make this work properly.
I noticed the regular testing didn’t help. If you want to test by sharing on your own page, you should add a random id to the end of your URL, e.g. http://www.google.com/?=34 and change the number again and again. If that doesn’t work, then it’s probably server side issue.
The culprits in server side:
- Your domain’s DNS records: Check that your records are right. For me the issue was CNAME alias in www, it seems Facebook is not a fan of those and prefers A-record in www instead. When I changed this and waited for the TTL, everything was fine. Still got the error, but it fetches the data without trailing slash in URL and that is the most important thing.
- Double check your records, there should not be anything that you don’t need
- Your SSL certificate has to be properly configured and valid.
- Check that your mod_security rules are not overly protective
- Check that Facebook crawler has access to your website and your other settings are not blocking Facebook.
- Configure your server’s whitelist and follow Facebook’s best practices here
For me the issue might have been CNAME (it was
www CNAME domain.fi., changed to
www A IPADDRESS). If you don’t have access to DNS or server settings, please let your system administrator know about these things.
I hope this helps!
Thanks for reading! I need your attention for a moment.
Did your problem got solved? Did you enjoy this post? If so, consider thanking me on Patreon. Doing this is not free and I'd love you buy me a beer or coffee. If you do that, I might be able to help you if you didn't get your problem solved with this blog post. I know my shit around areas like website design, coding, blogging, digital marketing and SEO so if you want to do business with me in other ways let me know.