如何向Google Search提交站点名称而非域名?

问题与现有代码
以下是我当前使用的meta代码:
<meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width,initial-scale=1"> <title>Login - {{ env('APP_NAME') }}</title> <meta name="description" content="Printing Cashier Application to Increase Your Business Efficiency"> <meta name="keywords" content="{{ env('APP_KEYWORD') }}"> <meta name="author" content="{{ env('APP_DEVELOPER') }}"> <meta name="robots" content="index, follow"> <meta property="og:title" content="{{ env('APP_NAME') }}"> <meta property="og:url" content="{{ env('APP_URL') }}"> <!-- PWA --> <meta name="theme-color" content="#000000" /> <link rel="apple-touch-icon" href="{{ asset('/') }}assets/images/settings/{{ $item->favicon }}"> <link rel="manifest" href="{{ asset('/manifest.json') }}"> <!-- Open Graph --> <meta property="og:title" content="Aplikasi Kasir Percetakan | Khalid R"> <meta property="og:description" content="Printing Cashier Application to Increase Your Business Efficiency"> <meta property="og:url" content="{{ env('APP_URL') }}"> <meta property="og:type" content="website"> <meta property="og:image" content="{{ asset('/') }}assets/images/settings/{{ $item->favicon }}"> <meta property="og:site_name" content="{{ env('APP_NAME') }}" />
需求:让Google搜索结果中显示站点名称,而非域名。
解决方法
- 确认
env('APP_NAME')的配置值是你想要展示的站点名称,而非域名。代码里的og:site_name和title标签都引用了这个变量,确保变量值准确是核心前提。 - 删除重复的
og:title标签,当前代码里出现了两次该标签,保留一个明确包含站点名称的版本即可,避免让搜索引擎产生识别混乱。 - 添加Schema.org结构化数据,直接向Google明确声明站点名称,在页面中插入以下代码:
<script type="application/ld+json"> { "@context": "https://schema.org", "@type": "WebSite", "name": "{{ env('APP_NAME') }}", "url": "{{ env('APP_URL') }}" } </script>
- 保持title标签的清晰格式,
Login - {{ env('APP_NAME') }}的结构没问题,只要{{ env('APP_NAME') }}对应正确的站点名称即可。
内容的提问来源于stack exchange,提问作者Khalid R
相关产品推荐
相关产品推荐

