SEO Meta Data Tag In Header of WordPress Theme

huangapple go评论61阅读模式
英文:

SEO Meta Data Tag In Header of WordPress Theme

问题

我有一个用于电影网站的自定义WordPress主题。我想为关键词添加元数据标签,但当我将它添加到WP主题的头部时,它对所有我的文章都有效,意味着会在所有文章中显示这些关键词,这就是为什么Google不会索引所有我的文章。是否有解决方案来修复这个问题,因为我只想在我的主页上使用这个,并且不使用任何插件。

<meta name="keywords" content="好莱坞电影下载, 动作电影, 高清电影">
英文:

I have a custom wordpress theme for movie website. I want to add metadata tag for keywords but when i add this in WP theme Header its work for all my posts mean show these keywords for all posts that's why google not indexing all my posts. Is there any solution to fix this because I only want this for my homepage and without any plugin.

&lt;meta name=&quot;keywords&quot; content=&quot;hollywood movies download, action movies, HD Movies&quot;&gt;

答案1

得分: 1

<?php if (is_home()) : ?>
    <meta name="keywords" content="好莱坞电影下载, 动作电影, 高清电影">
<?php endif; ?>
英文:
&lt;?php if (is_home()) : ?&gt;
    &lt;meta name=&quot;keywords&quot; content=&quot;hollywood movies download, action movies, HD Movies&quot;&gt;
&lt;?php endif; ?&gt;

答案2

得分: 1

  1. 打开您的主题的header.php文件。

  2. 找到文件中的部分。

  3. 在标签关闭之前,在部分添加以下代码:

<?php if (is_front_page()) : ?>
<meta name="keywords" content="好莱坞电影下载,动作电影,高清电影">
<?php endif; ?>
英文:

1.Open your theme's header.php file.

2.Find the <head> section of the file.

3.Add the following code within the <head> section, before the closing </head> tag:

&lt;?php if (is_front_page()) : ?&gt;
&lt;meta name=&quot;keywords&quot; content=&quot;hollywood movies download, action movies, HD 
Movies&quot;&gt;
&lt;?php endif; ?&gt;

答案3

得分: 1

关键词标签不再对SEO产生任何影响。

https://developers.google.com/search/blog/2009/09/google-does-not-use-keywords-meta-tag

英文:

The keywords tag no longer has any effect on SEO.

https://developers.google.com/search/blog/2009/09/google-does-not-use-keywords-meta-tag

huangapple
  • 本文由 发表于 2023年6月5日 11:20:50
  • 转载请务必保留本文链接:https://go.coder-hub.com/76403319.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定