从打开图形中排除图像 [英] Exclude image from Open Graph

查看:135
本文介绍了从打开图形中排除图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

tl; dr 我想在我的og:image标签中默认指定NO图像。

tl;dr I'm wanting to specify NO image by default in my og:image tag.

已经像一个疯子一样,像一个疯子一样把这一个看成一个,但是我发现的一切都是那些无法让自己的图像出现的问题,而不是阻止他们的图像显示出来。

所以,这是交易。在我的主页上,我的个人网站是我脸上的照片。现在,这是一个很好的图片(因为,嘿,这是一个很好的面孔),我想保留,但我不喜欢这是社会媒体刮板拾取每当我的链接共享 - 这只是一点点

So, here's the deal. On my personal website in my master page is a picture of my face. Now, it's a nice picture (because, hey, it's a nice face) and I'd like to keep it, but I don't like that it's picked up by social media scrapers whenever my links are shared - that just seems a little too egotistical.

我喜欢它拿起其他图像,像我偶尔在我的博文中包含的那些,但如果有我没有任何页面上的任何其他图像,那么我希望刮板忽略我的脸。

I DO like that it picks up other images, like the ones I occasionally include in my blog posts, but if there aren't any other images on a page then I want the scrapers to ignore my face.

我已经尝试了在生成og:image标签的代码我的 Yoast插件,然后将一个空的内容属性的标签硬编码到我的header.php :

I've experimented with commenting out the code that generates the og:image tag in my Yoast plugin, then hard coding the tag with an empty content attribute into my header.php:

<meta property="og:image" content="" />

这部分达到了预期的效果 - Facebook的刮板检测到没有指定图像url,但仍然似乎默认为可以找到的任何其他图像。

This partially achieved the desired effect - Facebook's scraper detects that no image url is specified, but is still seems to be defaulting to whatever other image it can find.

开放图协议似乎并没有包含指定no图像的行为。

The Open Graph protocol doesn't appear to include behavior for specifying no images, either.

有什么想法可以这样做?

Any thoughts on how I could do this?

编辑:我刚刚在这个问题中找到了一些解决方法可能会做的伎俩,但如果有任何其他想法,我会很乐意听到他们。

I just found some workarounds in this question that will probably do the trick, but if anyone has any other ideas, I would appreciate hearing them as well.

推荐答案

上传一个空白或至少200x200像素的100%透明图像,并在og:image标签中使用它。

Upload a blank or 100% transparent image with at least 200x200px and use it in the og:image tag.

这篇关于从打开图形中排除图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆