can’t get open graph for facebook to display properly
-
hi,
i’m having a hard time getting open graph to work properly for facebook. i’m thinking it might be a redirect issue?
here’s why i’m wondering that. about a week ago i transferred my snailhunters.com domain to my current webhost. i originally had only that domain with godaddy because i had a weebly blog but now i have a self hosted wordpress site. i wish to only display the snailhunters.com when blog posts are shared to facebook from my selfhosted wordpress site.
when i first installed Yoast i was able to share posts showing the big picture as it should. the only problem was it was showing the .NL domain instead of the .COM domain. i live in the Netherlands so the primary domain is with a .NL extension.
see this screenshot of how it looked 9 days ago: https://snipboard.io/HWSmEb.jpgonce my domain transferred over to my webhost, i was going to set the .COM url as my primary domain. however my webhost recommended i do not do that because i would have to change all of my file names as well. so i set the .com in the router so that people can still reach the site with both domain names.
now that the transfer is complete, i tried testing sharing a post to facebook today. however now the large image isn’t showing at all. it’s gone back to the small logo image and the .NL domain when i share posts to facebook. it looked like this when i tested it today. https://snipboard.io/VSk2B9.jpg
do i need to put additional code in the .htaccess file to get it to work properly? as far as i can tell, open graph is enabled. is there any other setting i’m missing? or is it a redirect issue with the domains? see this screenshot of my settings. https://snipboard.io/lsIJfy.jpg
The page I need help with: [log in to see the link]
-
Hello,
Thanks for reaching out.
If we understand correctly, the main URL is https://www.snailhunters.com/ because on visiting https://www.snailhunters.nl/, there is a 301 redirect to https://www.snailhunters.com/ then another 301 redirect to https://www.snailhunters.com/
We will like to mention that the website doesn’t load properly. You may want to check that out. See image.
And to confirm, do you want the Facebook sharing to look like it was 9 days ago (having the big image and .nl domain)?
hi,
the main url is snailhunters.nl with a redirect to snailhunters.com.
to confirm, i wish the facebook sharing to be like it was 9 days ago with the big image but it needs to have snailhunters.com instead of snailhunters.nl.strange i just checked and indeed the website wasn’t loading but it was before yesterday. thanks for letting me know. i couldn’t even log in as admin. i normally log in through the main website at snailhunters.nl/wp-admin but i got a message now that the page wasn’t loading properly because of redirect.
the webhost had added the following redirect code in my htaccess file but i still had the feeling that something isn’t quite right with the setup in the control panel.
is this what’s causing the site not to load? i removed it from the htaccess file and now it seems to be loading ok? can you reconfirm if the site is loading properly now from both domains? i wish it to be accessible by both domains but i wish ONLY the .com to be visible on the facebook open graph.
RewriteCond %{HTTP_HOST} !^www\.snailhunters\.com$ RewriteRule (.*) https://www.snailhunters.com/$1 [L,R=301] # BEGIN WordPress # The directives (lines) between "BEGIN WordPress" and "END WordPress" are # dynamically generated, and should only be modified via WordPress filters. # Any changes to the directives between these markers will be overwritten. <IfModule mod_rewrite.c> RewriteEngine On RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress # BEGIN ShortPixelWebp # The directives (lines) between "BEGIN ShortPixelWebp" and "END ShortPixelWebp" are # dynamically generated, and should only be modified via WordPress filters. # Any changes to the directives between these markers will be overwritten. # END ShortPixelWebp
edit: update: it seems the site is loading but when i click on a post to open it it says not found when i try on both urls?
maybe it’s going to be easier to start the website from reinstalling wordpress from scratch and deleting the current hosting package that is the .nl one and making a new hosting package that is .com as the main domain?
Thanks for the clarification; very helpful!
The site loads ‘properly’ a bit, though some icons don’t seem to load. See here. We are unable to give feedback regarding the state of the .htaccess file and the redirect rules; the web hosting provider will be in the best position to troubleshoot and resolve issues relating to that.
You mentioned wanting the Facebook share to have the big image and show snailhunters.com instead of the main URL, snailhunters.nl. Using the Facebook sharing debugger, this is how the sharing looks. Can you please confirm if you have filled the SEO title and meta description for the homepage?
Also, we see that the
og:url
is currently<meta property="og:url" content="https://snailhunters.com/home" />
. Can you share a screenshot of what you have in WordPress > Settings > General as the WordPress Address and Site Address?You’ll need to programmatically change the
og:url
by using thewpseo_opengraph_url
filter. Further information can be found here: https://developer.yoast.com/customization/apis/metadata-api/#opengraph-presentersregarding the site loading, it was still having issues so my webhost has cloned the site and made a hostingpacket for snailhuners.com so that now that should be the primary domain so now it shows only as snailhunters.com the url is now displaying correctly and the site is loading much better like it should now.
i do have the site title and description for the webiste filled out in the general settings. is this what yo mean by “SEO title and meta description” for the homepage or are you referring to something else?
see this screenshot: https://snipboard.io/B9Y4kx.jpg
i looked at the link you provided for programmatically changing the og:url but i am completely lost as to what all that means or how to do it. can you tell me what i need to change and where to get the big post picture to show instead of the logo?
@stargirl1 For a while, to confirm whether
og:url
is a cause, could you please go to SEO > Search Appearance > General(tab) page and upload the custom image for your homepage https://www.snailhunters.com/ and save the settings. Now, test the URL Facebook preview via Facebook debug tool. You may need to run the scrapping tool multiple times to see the expected output. Does that fix the issue?And also it seems .com and .nl are different WordPress setups. If you want to completely redirect .com to .nl, please request your web host to add proper redirects for you. Currently both websites https://www.snailhunters.nl/ and https://www.snailhunters.com/ can be accessed independently.
hi,
the snailhunters.nl is a separate wordpress setup but i will be deleting that next week after i am sure that the snailhunters.com is working properly. basically, we can just pretend like the snailhunteres.nl does not exist because eventually it won’t as a website. the snailhunters.nl is the original site. snailhunters.com used to be the domain only that was at godaddy but i wanted that to be the primary so i have moved it over to my current webhost and they have made a clone of my site to snailhunters.com. once the wordpress and all content is deleted from snailhunters.nl i will make that the domain only so that people can access the snailhunters.com site from both urls. but by next week, if everything goes as planned, there will only be one wordpress install and that will be snailhunters.com.
i’m not sure what you mean by “for a while”? or did you mean “for now”? as in temporarily? the logo on the search appearance page is fine. what i am talking about is when posts are shared on facebook. the logo for the search appearance is fine. i do not think that is the problem of the article images? however, per your suggestion, i have temporarily changed that image and rerun the debugger. and the problem still persists.
i ran the sharing debugger. i noticed there is an error at the top. it says:
Warnings That Should Be Fixed Inferred Property The 'og:image' property should be explicitly provided, even if a value can be inferred from other tags. Missing Properties The following required properties are missing: og:image, fb:app_id
i have also changed my posts page to the main website instead of the ‘home’ page but that did not resolve the problem either.
Thanks for following up and clarifying more on your existing websites. We will focus on resolving the issue on
.com
.In my previous response, I expected you to upload the social image for the homepage from the settings available here https://prnt.sc/165db6j. Have you tried it? Did you check the URL via the Facebook debugger tool? You may need to click Scrap Again button multiple times to clear the Facebook cache and see the correct image in the preview.
Likewise, on the individual posts, let’s see https://snailhunters.com/?p=10602. There’s
og:image
tag missing on the page source, therefore, the correct post preview won’t display on the shared post. To fix this, if you upload the custom image for this post from its Yoast SEO metabox > social field, and check the URL via Facebook debugging tool, does the correct image appear on the preview?hi, to clarify, there is only one website. snailhunters.com. snailhunters.nl is the old website that will eventually only be the url used for redirect to snailhunters.com so people can reach it from both domains.
yes i had done that and it did not change anything so i removed it. i’ve now added it back and today it does show the social image for the site. it took about 3-4 times running it through the debugger. see screenshot: https://snipboard.io/gSXn6L.jpg
however i tried running the post you linked through the debugger several times today and it still only shows the small logo on preview.
now when i try to share a post the logo is gone and it’s just the url. so it’s even worse than it was before. see screenshot: https://snipboard.io/rWbwHJ.jpg
-
This reply was modified 3 years, 9 months ago by
stargirl1.
Hi @stargirl1
We tested out https://snailhunters.com/ on Facebook’s Sharing Debugger Tool here and we do see the correct image being picked up in the preview.
I also tried it out on my personal Facebook account to test the preview and it did show the image as expected – https://snipboard.io/B6si9n.jpg
So we can confirm it’s working from our end. Perhaps you need to clear your browser’s cache and cookies, or try another browser or device and see if this resolves it.
hi,
your image is INCORRECT. it should show the ladybug picture for that post.
it should show the image that is associated with each article. not ONE IMAGE for all posts. (see screenshot in initial post again) like when you share an article from CNN on facebook it shows the corresponding image and not the same image on every post. and when it worked before i didn’t have to set a featured image for each article. it just automatically chose the first image in the article.
i just tested sharing it to facebook and it only shows the small logo why did it work correctly previously but not now? again, i do not want one image for all posts to facebook.
something else i just thought about, earlier you mentioned that “Also, we see that the og:url is currently <meta property=”og:url” content=”https://snailhunters.com/home”
does this need to be changed? the snailhunters.com/home page no longer exists. i changed it to have the posts on the start page instead of a page called home and i deleted that page.
Let’s see what’s going on and also review your settings once.
A. Homepage.
Your homepage URL: https://snailhunters.com/ when sharing on Facebook or Twitter is showing this Snail image in preview because your homepage currently has
og:image
set to that image probably in Yoast settings. HTML looks like this.<meta property="og:image" content="https://snailhunters.com/wp-content/uploads/2021/06/IMG_2480-1.jpg" />
We understand the above Snail image is in the preview is incorrect, it should show this lady bug.
picture.We suggest checking the social setting for your homepage:
1. Go to SEO > Search Appearance >> General and see if the Snail image is there already. If so, upload the correct Lady image and Save the settings.
2. Clear plugin and browser cache. Check the Facebook preview via a Facebook debugging tool. You may need to click the Scrap button multiple times until you get the correct ladybug picture.
B. Your individual posts
We understand you do not want the same image to appear for all posts you share on Facebook.
For example, when we check this post https://snailhunters.com/?p=10602, it does not have
og:image
tag on the page source. That means facebook look for relevant image from the post content and if it does not find appropriate image it fallback to the default logo image from the source. This is what happening when this post is shared on the Facebook.Therefore, to address this issue, edit the particular post and upload the Featured image or upload the custom image from the Yoast SEO metabox. Repeat #2 step above to check the correct preview.
Does this resolve the issue?
In most cases, it is due to server cache, facebook cache and plugins cache why output are not immediately visible. Therefore, we suggest clearing cache on each settings change.
Note: There is another option in Yoast SEO that lets you upload the default/fallback image. This image is used if the post/page being shared does not contain any images. Go to SEO > Social > Facebook(tab).
A. the home page has never been an issue.
B. regarding the post, i’m not sure what Yoast SEO metabox is.
however i think i discovered what i was doing wrong. i wasn’t setting an image for each post for the google, facebook and twitter preview: see this screenshot: https://snipboard.io/uBoEbZ.jpg
when i set those images per post it displays correctly. see this screenshot: https://snipboard.io/iJHpwW.jpg
that’s all well and good for the new posts but what about all my existing posts? do i have to go through and edit every single past post on my blog in order for the correct image to show?
Ideally, I don’t expect you would need to edit every single past post but sometimes it may be needed when for some reason post information was not correctly updated in the database. Sometimes this can be resolved by running SEO Data Optimization by going to SEO > Tools > and click the button SEO Data Optimization. After it completes, clear the cache and verifies if it resolves the issue.
If you’ve done this already there will be no optimization button visible.
However, you can still try resetting our indexables in the database tables by following the steps below?
1. Install & activate the?Yoast Test Helper plugin
2. Go to Tools > Yoast Test
3. Locate the Yoast SEO section and click on the ‘Reset indexables tables & migrations’. After each click, the page will reload to confirm that each reset was successful. Note: this won’t actually erase your SEO data, which is also stored in WordPress’ default tables. It’ll just reset our index (custom tables) for that data.
4. Go to SEO > Tools, and under SEO data, click the “Start SEO data optimization” button to allow Yoast to rescan your?content.If none of the above tricks resolved the issue, we suggest manually try updating the post.
-
This reply was modified 3 years, 9 months ago by
Suwash. Reason: formatting
hi, i haven’t had a chance to try all that yet. but i had one question before i do. is it because i’m using the free version of yoast?
-
This reply was modified 3 years, 9 months ago by
- The topic ‘can’t get open graph for facebook to display properly’ is closed to new replies.