Sharing Posts via Facebook
-
When I try to share a link to something that I have posted on my website it posts in this format – “(post title) – jakefreeland.com – jakefreeland.com”
Ideally, I would like it to read — “(post title) – jakefreeland.com”
If you didn’t guess, my website URL is http://www.jakefreeland.com
Anyone have any ideas?
-
This is what happens when someone likes my posts on Facebook. Example
https://developers.facebook.com/docs/reference/plugins/like/
If you read this link, it describes what attributes you can pass to the Like button in order to control how your links are posted.
Hope this helps.
If you’re using a plugin, this may be more difficult. For greater control, I normally build this into my templates.
I am not using a plugin, just copy/pasting a link to Facebook.
Cool, no worries.
What facebook is trying to do is scrape your page for info that is relevant. Sometimes the structure of your HTML restricts it’s crawler’s ability to do this.
Luckily FB have a basic meta data structure you can include in your WordPress theme which Facebook will find and use when pasting links into it. This includes setting the thumbnail, title of the link and the content box etc.
It’s on the link I posted above, under the heading ‘Open Graph Tags’. Read the page, it has all the information you need about sharing on Facebook.
So basically, I just throw the given code in my header and personalize it to my site?
Yup, you could do this on a per post basis in order to sculpt how your posts are shared, what is displayed etc.
Throwing it into your header with hardcoded values may always just show the same thing.
Just did a quick Google:
Found this plugin, which should help you out.
http://wordpress.org/extend/plugins/facebook-open-graph-meta-in-wordpress/ (I haven’t installed or tested it)
And I searched for ‘wordpress og meta plugin’ and found the below. It seems to be from the author of the plugin. So this may actually save you any hardship messing with code.
http://www.wpbeginner.com/wp-themes/how-to-add-facebook-open-graph-meta-data-in-wordpress-themes/
I may even start using it!
I tried it, but it is still doing the same thing as the example that I posted above.
Well try Googling some more, there are bound to be solutions out there.
Good luck.
Thanks for the effort.
No problem, if I figure out the solution myself, I’ll post it here.
Just a lack of free time at the min, and the fact it’s home time, so long work for another day 🙂
I think we might have had a bit of confusion?
To me, it seems like the Facebook Open Graph would be used if someone is trying to like my page in general (actually liking jakefreland.com).
However, what I am saying is when someone likes an individual post on my website it is displaying as such on Facebook — “[whatever the post title is] – jakefreeland.com – jakefreeland.com” — instead of what I want which is this –> “[whatever the post title is] – jakefreeland.com”
But maybe you are right and I am just doing it wrong…
I guess what I am trying to say is this — I don’t understand why it would post “jakefreeland.com” twice instead of just once. Or instead of posting my website description.
I don’t think I have misunderstood the problem, you’re wondering what text shows up in a users news feed when they like a post on your site. I got that, so read about how the Like button works.
Try looking at your title tag, most likely in your header.php of your theme.
“The Evolution of Bowser – jakefreeland.com | jakefreeland.com” – matching the image you posted, here’s the corresponding title of that post, which is what is been taken as the link title. Get rid of the two occurrences of your URL.
I’m pretty sure any other query you have with Facebook and how it displays can be fixed by looking at the Developers site for Facebook, or a spot of googling.
Facebook have a handy debugger to help with structuring your content so that it has maximum visibility to FB’s crawler.
<title> <?php if (function_exists('is_tag') && is_tag()) { single_tag_title("Tag Archive for ""); echo '" - '; } elseif (is_archive()) { wp_title(''); echo ' Archive - '; } elseif (is_search()) { echo 'Search for "'.wp_specialchars($s).'" - '; } elseif (!(is_404()) && (is_single()) || (is_page())) { wp_title(''); echo ' - '; } elseif (is_404()) { echo 'Not Found - '; } if (is_home()) { bloginfo('name'); echo ' - '; bloginfo('description'); } else { bloginfo('name'); } if ($paged>1) { echo ' - page '. $paged; } ?> </title><meta name="title" content="<?php if (function_exists('is_tag') && is_tag()) { single_tag_title("Tag Archive for ""); echo '" - '; } elseif (is_archive()) { wp_title(''); echo ' Archive - '; } elseif (is_search()) { echo 'Search for "'.wp_specialchars($s).'" - '; } elseif (!(is_404()) && (is_single()) || (is_page())) { wp_title(''); echo ' - '; } elseif (is_404()) { echo 'Not Found - '; } if (is_home()) { bloginfo('name'); echo ' - '; bloginfo('description'); } else { bloginfo('name'); } if ($paged>1) { echo ' - page '. $paged; } ?>">I now see that it is reading as follows —
<title>The Evolution of Bowser - jakefreeland.com | jakefreeland.com</title>— in both my title and <meta name=”title” content=.So, I should delete the provided code and replace it with the Facebook OG?
The topic ‘Sharing Posts via Facebook’ is closed to new replies.