Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

LATEST UPDATE (June 13th 2012)

I can't figure out what's wrong with my codes. When I want to share one of my blog posts and use either the Facebook share button or copy the link of the blog post directly into Facebook all that pops up is the URL itself, not the meta info such as description or featured image! I filled out the meta data for each and every post and I also added Open Graph to my code.

Yet, when I try to share my blog post links on Facebook, neither the meta description nor a thumbnail would show up for the majority of my blog posts. It's like something is blocking the information. I've run out of ideas. I really hope you guys can help me figure out what's wrong! (obvioulsy I replaced the fillers above with my own data!)

I also used the Facebook Debugger and all it tells me is:

Can't Download: Could not retrieve data from URL.

Updated Information:

I finally was able to figure out what was wrong thanks to Milo and MathSmath! The W3 Cache Plugin is interfering with the Facebook sharing progress, but it's quite easy to change that. Scroll down to see my answer! Works like a charm!

share|improve this question

put on hold as off-topic by Pieter Goosen, birgire, Johannes Pille, ialocin, Rarst 2 days ago

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Your question should be specific to WordPress. Generic PHP/JS/HTML/CSS questions might be better asked at Stack Overflow or another appropriate site of the Stack Exchange network. Third party plugins and themes are off topic." – Pieter Goosen, birgire, Johannes Pille, ialocin, Rarst
If this question can be reworded to fit the rules in the help center, please edit the question.

6 Answers 6

up vote 1 down vote accepted
+50

I'd guess this has something to do with your caching layer. The Facebook linter says it's getting a 206 response to the example link you posted. A 206 means the response contained only partial content, and is often the result of a caching mechanism. It also has some pretty strict validation rules, and your response header may be malformed (for example, it looks to me like it's missing a content-type header, just at a glance).

Try disabling your caching plugin, and reverting your htaccess to the bare-bones WordPress version (the lines between the "begin WordPress" and "End WordPress" comments at the bottom). See if that helps?

share|improve this answer
    
Thank you for your suggestion! I tried what you said, but I get a "200" error code. It's still not working. I'm editing my question and will put my header.php in there. Maybe you can find something in there? –  japanworm Jun 12 '12 at 15:04
3  
206 is a normal response because FB only asks for the first 40k of the file. i agree though, it may be the .htaccess rules related to caching, user agent seems to trigger the bad response. –  Milo Jun 12 '12 at 15:18
    
Ok, but I changed the .htaccess file only leaving what was between "begin Wordpress" and "End Wordpress" and it didn't work. –  japanworm Jun 12 '12 at 16:23
    
@Milo Wait, I just saw that with the 200 error that I get I can actually share on Facebook. Only the thumbnail won't work. That still needs to be fixed. The error message is: Object at URL 'zoomingjapan.com/travel/momoyama-castle-kyoto/'; of type 'article' is invalid because the given value '377035309011137' for property 'fb:admins' could not be parsed as type 'fbid'. –  japanworm Jun 12 '12 at 16:28
1  
@Milo Good to know RE FB only asking for 40k of the file. japanworm: 200 is a good response--it means everything's cool. I just tested the example URI you included in your last comment, and it looks like it works just fine--though now it says all your Open Graph tags are missing, so it just includes default values. If you put your OG tags back in, does it work the way you expect? –  MathSmath Jun 12 '12 at 18:52

I've come across this same problem before... a few things you can do.

In your website, make sure you have.....

  • An appropriate image close to the top of the page, title and alt tag are relevant

  • A "description" META tag this is a tag that occurs in the <head></head> of the page example: <meta name="description" content="enter your description here" />

  • A chunk of web friendly text within a <p> tag somewhere on the page. By web friendly I mean actual text... not an image embedded with text.

I found these 3 things helped me improve that little publish to facebook functionality.

Hope that helps.

share|improve this answer
    
Sounds great! I do understand the first point you mentioned. I'm not sure I know what the other 2 mean. What exactly is a "META" tag? And can you elaborate what exaclty a web friendly text within a tag would be? Thanks so much! :) –  japanworm May 29 '12 at 17:21
    
@japanworm updated the post above to make a little more descriptive. –  Simon May 30 '12 at 5:33
    
Thank you. I understand what you're saying. Yet some of my posts don't offer any description text or image although all of my posts' structure is pretty much the same. Others work fine. Very weird. –  japanworm May 31 '12 at 3:10

Heres a great article I found on custom meta tags today http://umairj.com/29/modify-how-the-shared-item-appears-on-facebook/

share|improve this answer
    
Awesome. Thanks so much! Let's see if I can get it to work with that. –  japanworm Jun 2 '12 at 2:17
    
This might be a stupid question, but do I need to prepare every single blog post or can I just change my single.php file so that all future blog post will be the way they need to be for Facebook? –  japanworm Jun 6 '12 at 16:23
    
I tried to add this code (wpbeginner.com/wp-themes/…) to my function.php, but it still doesn't work! Any other suggestions? –  japanworm Jun 9 '12 at 15:18

Are you using a plugin that does mobile detection? visiting your site with an iOS user agent returns a bunch of garbage characters, I'll guess you have some user agent issues with the Facebook crawler and it's not getting your site's actual markup. click the link in the FB debugger that shows exactly what the crawler sees, your site's head tag is almost completely empty.

share|improve this answer
    
Sorry, I don't know if any of the plugins is using mobile detection. Should I deactivate all plugins and see if it works then? –  japanworm Jun 10 '12 at 15:35
    
@japanworm something is serving different versions of your site based on what browser the visitor is using, is that your theme, or a plugin? –  Milo Jun 10 '12 at 15:52
    
It is? That wasn't my intention. I don't know if it's my theme or a plugin. How can I find out? I couldn't test my website on a mobile device, but I checked it in various browsers and never had any issues. –  japanworm Jun 10 '12 at 16:02
    
@japanworm both safari and chrome let you set the user agent in their developer tools so you can masquerade as an iOS visitor. Try turning off plugins and switching theme to see if it persists. –  Milo Jun 10 '12 at 16:09
    
It wasn't the plugins, it's my theme. I tried one of the WP standard themes and there was no issue. I could share blog posts that I couldn't before. What's the next step? –  japanworm Jun 10 '12 at 16:20

Thanks to Milo's and MathSmath ideas, I was able to figure out a solution myself. Apparently a lot of people have issues with W3 Cache and sharing on Facebook. There's quite a simple solution to it, though!

Go to the W3 Cache plugin settings, more specifically to "page cache" and make sure to reject these user agents:

facebookexternalhit

FacebookExternalHit/1.1

FacebookExternalHit/1.0

This will block W3 Total Cache from sending cached pages to Facebook.

Personally I still have issues when using the "like" or "share" button in my blog. The "Like" button sometimes doesn't provide the right thumbnail, but I'm sure I can fix that, too. I might update this answer then. The "share" button I use doesn't work at all. I guess I need to find another code for the Facebook share button and try again. Copying the URL directly into Facebook to share something works fine now!

share|improve this answer

Applied the above solution - modifying the user agents. The procedure that solved the issue was from the facebook developers site.


Go to the following link.

https://developers.facebook.com/tools/debug to determine if Facebook detects your og:image. If not, add some code.

With the new Facebook Open Graph stuff, you can define a thumbnail for that page in your "head" of the form<meta property="og:image" content="[image url]"/>

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.