简体   繁体   English

为什么有诸如Facebook / Digg / Reddit之类的网站无法解析页面上用于标题/描述的适当元标记的原因?

[英]Is there a reason why sites like Facebook/Digg/Reddit would not parse the proper meta tags on a page for title/description?

Any given article on our site has the meta tags for title, description, image, and keywords in the head element, but for some reason none of the news aggregate sites won't pull any of it. 我们网站上的任何给定文章在head元素中都具有用于标题,描述,图像和关键字的meta标签,但是由于某些原因,所有新闻汇总网站都不会将其提取。

http://darthhater.com/2010/06/25/friday-update-preview http://darthhater.com/2010/06/24/official-bioware-stance-on-game-testing-leaks http://darthhater.com/2010/06/25/friday-update-preview http://darthhater.com/2010/06/24/official-bioware-stance-on-game-testing-leaks

Not trying to post an advertisement. 不尝试发布广告。 We really do have a problem. 我们确实有问题。 The share link is in the bottom right of the article with links to Facebook, Digg, and Reddit. 共享链接位于文章的右下方,其中包含指向Facebook,Digg和Reddit的链接。 It's too bad none of them provide debugging systems to figure out why stuff is improperly pulled into their system. 太糟糕了,他们都没有提供调试系统来弄清楚为什么东西被不正确地引入了他们的系统。

I'm thinking it might have something to do with the gzip compression of the site, or maybe because the PHP XSL parser is outputting the site as XML (I remove the start tag programmatically, but even if I set the XSL to 'html' the problem persists. I thought maybe it had to do with stripped whitespace, or the order of the meta tags (ridiculous, I know). It's a little annoying, and if I put our URLs into SEO checkers like seocentro.com it find all of the meta tags just fine, so it's obviously not a page parsing error on their end. 我认为这可能与网站的gzip压缩有关,或者可能是因为PHP XSL解析器将网站输出为XML(我以编程方式删除了开始标记,但即使将XSL设置为“ html”问题仍然存在,我认为可能与剥离的空格或meta标签的顺序有关(我知道这很荒谬),这有点令人讨厌,如果我将URL放入seocentro.com之类的SEO检查器中,它会找到所有个meta标签就可以了,因此在它们的末尾显然不是页面解析错误。

My shot in the dark is that this is because you have the head part in one huge line: 我在黑暗中的镜头是因为您的head位于一条巨大的直线上:

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:magasi="http://www.magasi-php.com/" xmlns:php="http://www.w3.org/1999/XSL/Transform"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><meta name="title" content="Friday Update Preview" /><meta name="description" content="Sean Dahlberg, Star Wars: The Old Republic Community Manager, informs the community that tomorrow's update will be a late one:  Just wanted to let everyone kno..." /><link rel="image_src" href="http://darthhater.com/images/fbimage.jpg" /><meta name="keywords" content="Friday Preview,Sean Dahlberg" /><link rel="alternate" type="application/rss+xml" title="Darth Hater - A Star Wars: The Old Republic Community RSS Feed" href="http://darthhater.com/feed/" /><link type="text/css" rel="stylesheet" href="/styles/DarthHater/style/main.css" /><script type="text/javascript" language="javascript">

it's probably valid HTML, but I wouldn't be surprised if a parser choked on it. 它可能是有效的HTML,但是如果解析器阻塞了它,我不会感到惊讶。

Also, you have 438 validation errors . 此外,您还有438个验证错误 This is probably not your problem, as it's mostly minor things and parsers should be able to deal with invalid HTML, but one never knows. 这可能不是您的问题,因为这主要是次要的事情,解析器应该能够处理无效的HTML,但是从来没有人知道。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用PHP从Facebook页面获取标题和元标记 - Get title and meta tags from Facebook page with PHP 更改页面标题不适用于 facebook 元标记 - changing title of page doesn't work with facebook meta tags 从 url 获取元描述、标题和图像,如 facebook 链接共享 - get meta description , title and image from url like facebook link sharing 如何使用laravel黄昏浏览器测试来测试页面标头标签(例如meta标签,description等)? - How to test page header tags like meta tag, description etc with laravel dusk browser test? 如何将URL硬编码为Digg Digg Facebook like button? - How to hardcode an URL to Digg Digg Facebook like button? 如何在 WooCommerce 类别页面中添加元标题和元描述 - How to add Meta Title and Meta Description in WooCommerce category page 网站如何将动态php内容放入facebook meta标签? - How do sites put dynamic php content into facebook meta tags? 像Digg(PHP)这样的Facebook Connect网站 - Facebook Connect Site Like Digg (PHP) 如何获取具有 cookie 同意页面的网站的标题、缩略图和描述(Facebook/Twitter 等预览)? - How to get title, thumbnail and description of websites (Facebook/Twitter like preview) that have a cookie consent page? 获取元标题和描述 - Getting meta title and description
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM