Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

og:image:secure_url #3545

Closed
jeroennicolai opened this issue Dec 7, 2015 · 6 comments
Closed

og:image:secure_url #3545

jeroennicolai opened this issue Dec 7, 2015 · 6 comments

Comments

@jeroennicolai
Copy link

The facebook meta tag og:image:secure_url isn't generated by yoast.
Is there a solution for it?

@Rarst
Copy link
Contributor

Rarst commented Dec 7, 2015

As far as I am familiar with the tag it is relevant when both secure and unsecure versions of image are available. Unfortunately WordPress has no such concept, it either runs in one context or another. As such it is hard to figure out contexts where both URLs are possible with code.

If you need this tag you could use provided filters to output it yourself.

Does this answer your question?

@denvers
Copy link

denvers commented Jan 4, 2016

I encounter issues using og:image on a https website. http://ogp.me/#structured says this about secure url for open graph images: "og:image:secure_url - An alternate url to use if the webpage requires HTTPS."

So, if the webpage requires HTTPS (which is in my case), you should use og:image:secure_url

Update: I fixed my Open Graph issue by adding og:image:secure_url and testing it afterwards in the official Facebook Debug tool: https://developers.facebook.com/tools/debug/og/object/

@Rarst
Copy link
Contributor

Rarst commented Jan 5, 2016

@denvers had you had secure or not secure image URL in og:image tag? Had you got an error or warning about it from Debugger?

@denvers
Copy link

denvers commented Jan 5, 2016

@Rarst I only had og:image, now I have both and this seems to be the fix for me at least.

@TechRemarker
Copy link

Also have this issue. Site is running on https (non http urls forward to https automatically via cloudflare.

In Yoast I added open graph image in settings. It shows up as http:// in the code even though it should instead show up as "//example.com/image.jpg" and it should use og:image:secure_url but there is no option to say its an https server in the backend and it doesn't automatically determine it.

So when using the Facebook linter, it says I need explicity define open graph image and it's pulling an image at random which I assume is because it's an https site and the yoast tag is using http and not og:image:secure_url. Looks like the temporary fix would be to hard code og:image:secure_url into head until https new issue is resolved. Though that would mean it will be the same image for all pages.

Unless there is another more elegant temporary solution?

@Rarst
Copy link
Contributor

Rarst commented Jan 11, 2016

It shows up as http:// in the code even though it should instead show up as "//example.com/image.jpg"

WP is not to keen on protocol-relative URLs. Do you mean that you are saving this URL in option explicitly? It's likely sanitization enforces protocol somewhere in code. Had you tried just saving https URL?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants