【问题标题】:Angular 4 website description at google search [duplicate]谷歌搜索中的 Angular 4 网站描述 [重复]
【发布时间】:2018-09-24 13:17:21
【问题描述】:

我在 Angular 4/5(not Universal)中创建了一个网站。当我想在谷歌搜索中找到我的网站时,我的网站没有任何描述,只有标题。 有没有办法在不使用 Angular Universal 的情况下改变这一点?我不想要任何 seo 优化,只是这个描述。

【问题讨论】:

  • 您的应用使用角度路由?
  • 我投票决定将此问题作为题外话结束,因为它是the scope defined by the SEO tag wiki page 之外的 SEO 问题。这可能是the webmasters stackexchange 的主题
  • 不要关闭这个问题。 Angular 具有添加元描述标签的 API,如我的回答中提供的那样。
  • 是的,我的应用使用路由。

标签: html angular seo


【解决方案1】:

您需要在 index.html 中添加“描述”元标记。比如下面这张。

<meta name="description" content="[Your description goes here]">

使用下面的链接将您的网站 URL 添加到 Google。 https://www.google.com/webmasters/tools/submit-url

并且这可能需要很短的时间才能反映在 Google 搜索中。

Google 文档链接 - https://support.google.com/webmasters/answer/35624?hl=en

【讨论】:

    【解决方案2】:

    利用Meta 可注入服务。

    示例用法

    import {Component} from '@angular/core';
    import {Meta} from '@angular/platform-browser';
    
    @Component({
      selector: 'app-component',
      template: 'my awesome app'
    })
    export class AppComponent {
      constructor(private meta: Meta) {
        this.meta.addTag({ 
          name: 'description', 
          content: `My site's description that will show in google`
         })
      }
    }
    

    【讨论】:

    • Google 抓取工具看不到这些标签。我的应用程序不是服务器端渲染器 - 这是问题吗?
    猜你喜欢
    • 1970-01-01
    • 2015-04-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-10-14
    • 1970-01-01
    相关资源
    最近更新 更多