【问题标题】:Custom description for Google search resultsGoogle 搜索结果的自定义描述
【发布时间】:2020-06-23 22:07:32
【问题描述】:

当我在 Google 上搜索时,描述总是根据元标记自动生成。但是,当我添加其他关键字时,我可以影响显示的文本,然后描述将突出显示所述页面中的这些词。这是一个小例子

Google search result without keywords

Google search result with additional keywords

这表明您可以处理页面而无需打开它。有没有办法增加描述长度大小或仅根据其在页面上的位置或 html 标签显示特定信息?

【问题讨论】:

标签: html metadata search-engine google-search


【解决方案1】:

有没有办法增加描述长度大小或仅根据其在页面上的位置或html标签显示特定信息?

简短的回答,不是,而是页面的内容does matter,尤其是在没有设置元描述的情况下。

例如,https://example.com/ 没有 meta 描述,因此 Google 通过解析页面内容来组成描述。

<!doctype html>
<html>
<head>
    <title>Example Domain</title>

    <meta charset="utf-8" />
    <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <style type="text/css">
    body {
        background-color: #f0f0f2;
        margin: 0;
        padding: 0;
        font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;

    }
    div {
        width: 600px;
        margin: 5em auto;
        padding: 2em;
        background-color: #fdfdff;
        border-radius: 0.5em;
        box-shadow: 2px 3px 7px 2px rgba(0,0,0,0.02);
    }
    a:link, a:visited {
        color: #38488f;
        text-decoration: none;
    }
    @media (max-width: 700px) {
        div {
            margin: 0 auto;
            width: auto;
        }
    }
    </style>    
</head>

<body>
<div>
    <h1>Example Domain</h1>
    <p>This domain is for use in illustrative examples in documents. You may use this
    domain in literature without prior coordination or asking for permission.</p>
    <p><a href="https://www.iana.org/domains/example">More information...</a></p>
</div>
</body>
</html>

【讨论】:

  • 实际上,当您想要获取特定详细信息时,您可以添加前面的关键字(“此域用于使用”将显示“文档中的示例”),但有时您正在寻找的文字不是很精确,这就是我寻找替代品的原因。