简体   繁体   English

PHP和关键字

[英]PHP and Keywords

I would like to know if I can make a php script that will allow me to echo keywords into a meta tag.To be more precise will the keywords echoed by the php script be indexed by search engines? 我想知道我是否可以制作一个PHP脚本,使我可以将关键字回显到meta标签中。更确切地说,php脚本回显的关键字是否会被搜索引擎索引? I don't need the actual script I just need to know if this will be any good for indexing. 我不需要实际的脚本,我只需要知道这对索引编制是否有好处。

Sure you can. 你当然可以。 They will also be seen by Google crawler/bot. Google搜寻器/漫游器也会看到它们。 The reason is that PHP is server-side language, your code is generated on server and sent back to browser for people and search engines to see. 原因是PHP是服务器端语言,您的代码在服务器上生成,然后发送回浏览器供人们和搜索引擎查看。

From what I know it won't do you any good. 据我所知,这对您没有任何好处。 The search engine crawlers will see your meta tag, but Google, for example, ignores the keywords when determining relevance. 搜索引擎抓取工具将看到您的元标记,但例如Google在确定相关性时会忽略关键字。

If you want search engine visibility you should focus on your content and presentation. 如果您希望搜索引擎可见,则应重点关注内容和演示文稿。 Be sure to follow the w3c recommendations on publishing HTML content. 确保遵循有关发布HTML内容的w3c建议。

search engines crawl web pages (actually their "robots" do). 搜索引擎抓取网页(实际上是他们的“机器人”抓取的网页)。 how you generate the content of the pages is not relevant. 与页面内容的生成方式无关。 important is that you generate the content in a SEO (search engine optimization) way. 重要的是您以SEO(搜索引擎优化)的方式生成内容。

it is best to check out googles ressources on how to structure that content: http://www.google.com/support/webmasters/bin/answer.py?hl=en&answer=35291 最好查看Google的资源,以了解如何构建该内容: http : //www.google.com/support/webmasters/bin/answer.py?hl= zh_CN& answer=35291

You can try something like this: 您可以尝试如下操作:

<meta name="keywords" lang="<?=$language;?>" content="<?=$keywords;?>"  />

The variable $keywords should contain the keywords separated with , for example: "news, php, java, perl" 变量$ keywords应包含以分隔的关键字例如: “ news,php,java,perl”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM