og:image meta tag is missing
-
Hi! At some point, the
<meta property="og:image">
tag has disappeared on a clients site.
I also can’t upload a custom share image to a post/page, since Yoast says the file format is invalid, even though I’ve tried both.jpg
and.png
.The plugin is updated and I’ve tried to deactivate all other plugins and switched theme to Twenty twenty. No custom code should be causing this, so I guess the problem might be somewhere in the DB?
Any suggestions of what I could try next would be much appreciated! ??
-
Hi @stefanledin,
Thanks for testing this without any plugins activated. File formats like jpg and png should already be supported, so we’re not sure where the problem is happening.
1. Can you send us the error message or share a link to a screenshot of the error?
2. If you go to Media > Add new, are you able to upload the image directly into the Media Library?
3. Can you confirm that the image doesn’t exceed the file size and upload size limits for your site? You can find more details in this article.
1. https://snipboard.io/kqewgY.jpg
2 & 3. Yes, I’ve tested other share pictures that we’ve made for other clients. These are working with Yoast on other sites.
However, before updating Yoast to the latest version, 15, we were running 12.5.1. I was digging into the source code and found that the image mime type wasn’t valid.
Theis_valid_image_type()
method in theWPSEO_OpenGraph_Image
class (wordpress-seo/frontend/class-opengraph-image.php, line 593) returnedfalse
which caused the missing<meta>
tag. The method said that the mime type wasimage/x-png
orimage/x-jpg
. The<meta>
tag showed up if I added those to the$valid_image_types
array (line 62.)
As I said, the code I’m referring to existed in version 12. 15 is way different and I haven’t found the corresponding code in that version.I hope this info could give you some clue about what the problem might be ??
Thank you!Hi,
Would it be possible for you to download a fresh copy of v15.0 of Yoast SEO for WordPress and then manually update the plugin via FTP? You can find the instructions here — https://yoast.com/help/how-can-i-update-my-free-plugin/#ftp
Are you then able to add the open graph image in the Social tab of the Yoast SEO meta box when editing a post or page and does it also output the
og:image
tag in the page source?Hi Michael!
Yes, with v15 I’m able to add an open graph image in the social tab. But theog:image
tag is still missing.
Thetwitter:image
tag is working though, so it’s only the Facebook image that isn’t working.Hi @stefanledin ,
Will it be possible for you to share the URL that’s missing the og:image tag?
@stefanledin thanks, but that seems a path to the image. Can you please show us some example post URLs where the issue occurs so that we can take a look at them?
Sure, home page and an article page for example.
Hi,
Upon checking https://www.gardochdjurhalsan.se/nyheter/nu-ar-hosten-har-och-det-ar-dags-for-betackning-i-manga-besattningar/, we do see that it is using the latest version of Yoast SEO for WordPress v15.0. There is also no
og:image
tag in the source code. If you try to add an open graph image in the Facebook tab of the social section of the Yoast SEO meta box, are you still encountering any sort of errors?Also, just to be sure, we would like to rule out any plugin or theme conflicts that may occur. The fastest way to do this is to?deactivate all non-Yoast plugins and switch to a standard theme?like?Twenty Nineteen.?
Test this on your development or staging site, if you have one. If not, we recommend using the?Health Check & Troubleshooting?plugin. This plugin allows you to run a conflict check?without affecting normal visitors to your site.
As we can imagine that you’re unfamiliar with checking for conflicts, we’d like to point you to a step-by-step guide that will walk you through the process:?How to check for plugin conflicts.
If you try to add an open graph image in the Facebook tab of the social section of the Yoast SEO meta box, are you still encountering any sort of errors?
I can’t. I get a warning about the file type, it says only JPG, PNG and GIF are supported. I’m trying to do this on this article and using the same image that’s already uploaded to the article. It’s bigger than 1200×630, but there’s nothing special about it otherwise.
Also, just to be sure, we would like to rule out any plugin or theme conflicts that may occur. The fastest way to do this is to deactivate all non-Yoast plugins and switch to a standard theme like Twenty Nineteen.
I already did that before posting this issue here. I’d be happy to help you out by digging into the code and add
die(var_dump())
in some place, just tell me where ??Test this on your development or staging site, if you have one. If not, we recommend using the Health Check & Troubleshooting plugin. This plugin allows you to run a conflict check without affecting normal visitors to your site.
I’ve checked this and it doesn’t report anything special.
Thanks for your time!
Hi @stefanledin,
Thank you for your reply and patience with this issue.
The image you linked is 9.5MB in size and has a resolution of 5184?×?3456 pixels. Especially the file size might be a problem on your side. We didn’t have any issues using this specific image in a local testing environment. Can you please check if your host has limited the upload_max_size or post_max_size?
In any case, 9.5MB is very big and we would recommend making the image smaller and compressing the image to get the filesize lower.
Can you check if that works for you?
Yes I know it’s too big in this context, but it’s already uploaded through the media library so that can’t be the issue. The max upload size is set to 512 mb since the customer wants to upload quite big files sometimes.
I’ve tried with a share image that we’ve made for another customer (1200×630 px, 38 kb) and that doesn’t work either. The error message says the same thing, that only JPG, PNG and GIF are supported. The image works perfectly fine on the other clients site, also using Yoast.
As I’ve said before, there must be an issue with this particular WP installation since it remains without all other plugins and with a standard twenty* theme. I’d be happy to dig into the source code if you point me into the right direction ??
Hi @stefanledin,
Just to test the image, we downloaded and set the example article’s image as a featured image and as a Facebook image on a test site.
We found that we weren’t able to reproduce the error or the missing og:image meta tags on a test site, so we agree that this must be an issue with your particular site’s WP installation or the site’s settings. Can you try uploading a new copy of the image and replacing the image in the article?
If you find any information that there may be a bug in Yoast SEO with certain WordPress configurations, the best next step would be to create a new issue for our developers at?https://github.com/Yoast/wordpress-seo/issues/new/choose/.
You will need an account to create a new issue. If this is your first bug report, please check out:?https://kb.yoast.com/kb/how-to-write-a-good-bug-report/.
Hi again!
I’ve finally found a solution to this problem. It turned out that it had nothing to do with Yoast after all. For the record, here’s what happened:I had the WP Extra File Types plugin installed, which for some reason made uploaded images have the mime type
image/x-citrix-jpeg
instead ofimage/jpeg
. Yoast didn’t accept that mime type, which caused the issue with the missingog:image
meta tag.So, with the plugin inactivated, images got the mime type
image/jpeg
instead and Yoast stoped complaining about invalid image types. Since the mime type is stored in the database, just inactivating the plugin didn’t help. That’s why I was so sure about this being a Yoast issue.Thanks for the support, and I hope this helps someone in the future ??
yoast plugin mising after updating the plugin to the latest version – Yoast SEO v15.2?
kindly help me to get back that plugin into plgin admin area
- The topic ‘og:image meta tag is missing’ is closed to new replies.