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.
I stumbled on many tips that hint the issue may be on the server side, for example in Stack Overflow and Dreamhost discussions.
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.
Thanks for taking the time to collate your experience. Ironically I was about half way through the same approach you followed. Still not resolved it yet but hopefullly your experince will help fix this. It’s really annoying and I get a fair few grumpy messages from my users, annoying that this only happens with facebook.
After all I’m not sure if it was the CNAME really, because experienced it for a while even after that, but then the problem solved itself (I think when Facebook purged its cache after a long time). Bizarre issue indeed.
can you please explain in detail,, about “Double check your records, there should not be anything that you don’t need” “SSL certificate ” and “mod security rules.
Check your DNS (name server) records that there is not some erroneous CNAME values or anything you don’t particulary need. If you don’t have DNS record control, you’ll have to ask this from your hosting provider.
For me changed the CNAME solved my issue
This is an example of how my DNS is set up. What changes would I need to make for this shit to work. I am really happy that you guys seem to be on to something here 🙂 Have tried for a year to fix this, and I pretty much a noob on this. I do use SSL certificate which gives a green light so I think it is set up properly. image width and hight are set up to display in open graph data.
Name TTL Class Typ Record Action
sweden.com. 14400 IN A 70.39.270.15 Edit Delete
localhost.sweden.com. 14400 IN A 127.0.0.1 Edit Delete
mail.sweden.com. 14400 IN CNAME sweden.com Edit Delete
http://www.sweden.com. 14400 IN CNAME sweden.com Edit Delete
http://ftp.sweden.com. 14400 IN A 70.39.270.15 Edit Delete
cpanel.sweden.com. 14400 IN A 70.39.270.15 Edit Delete
webdisk.sweden.com. 14400 IN A 70.39.270.15 Edit Delete
cpcalendars.sweden.com. 14400 IN A 70.39.270.15 Edit Delete
cpcontacts.sweden.com. 14400 IN A 70.39.270.15 Edit Delete
whm.sweden.com. 14400 IN A 70.39.270.15 Edit Delete
webmail.sweden.com. 14400 IN A 70.39.270.15 Edit Delete
sweden.com. 14400 IN TXT v=spf1 a mx include:mpmserv.co.uk include:mpmserv2.co.uk include:mpmailserv.co.uk ?all
The copy paste list formatting is a bit messy, but it seems you have CNAME here:
So if it http://www.sweden.com CNAME sweden.com
Replace it with http://www.sweden.com A youripaddresshere
But be careful, I don’t know about your hosting if it supports setting it this way, you could mess up your site visibility if not careful. Don’t blame us for that! 🙂
Thanks for the fast answer! I have no static IP adress, I use VPS. But there is an ip adress for cpanel, I know so much. Is that the one I should use then? I use inmotionhosting by the way!
Yeah, you can change it back easily, just backup the current records to your notes before changing them.
You can check the IP address by pinging that host and see where it points to: https://www.adminlabs.com/network-tools/ping-test