Multiple <meta> Tags with the Same Name

末鹿安然 提交于 2019-12-28 14:37:11

问题


I need to specify multiple copyrights or authors using the <meta> tag. Can I use a <meta> tag with the same name multiple times?

<meta name="copyright" content="Company A" />
<meta name="copyright" content="Company B" />

Will the search engine respect both values? Or, do I need to comma-separate them in one <meta> tag?

Thanks.


回答1:


Using multiple meta tags with the same name is valid HTML.

But we don't know how search engines and other readers will interpret them. Either two meta tags will be concatenated or one of them will be ignored/overwritten.

Example: The PHP-function get_meta_tags() will ignore multiple meta tags with an equal name.

To avoid possible problems I would recommend to use a single meta tag:

<meta name="copyright" content="Company A, Company B" />



回答2:


If the page contains multiple meta tags of the same type, Google will aggregate the content values. For instance, they will interpret

<META NAME="ROBOTS" CONTENT="NOINDEX">
<META NAME="ROBOTS" CONTENT="NOFOLLOW">

The same way as:

<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">

More details here:http://googlewebmastercentral.blogspot.ro/2007/03/using-robots-meta-tag.html

I guess most other search engines would handle the meta tags in the same way.



来源:https://stackoverflow.com/questions/6531761/multiple-meta-tags-with-the-same-name

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!