doubi3996 2013-02-04 19:41
浏览 39
已采纳

PHP:如果用户代理是搜索引擎爬虫,则不输出日期

One of my websites has blog-style updates on the home page, but the website is certainly not a blog. It is being indexed by Google and the search engine results page summary shows the date of the latest update. I do not want the date to show in the search engine results page. I've found other posts related to this issue suggesting to render the date using javascript after the page is loaded (tried and google still gets it), or to render the date as an image (would prefer to avoid doing that).

I was wondering if I could simply use PHP to detect if the user agent is a Google bot (or bing, etc.) and in those cases just not output the dates on posts. Is there any drawback to this? Would the search engines be able to detect that I am giving them a modified version of my site and would they penalize me for it?

  • 写回答

1条回答 默认 最新

  • dqudtskm49788 2013-06-08 05:00
    关注

    Please do not do it. This is considered black hat SEO, and you have a chance of being penalized.

    Google do not just go to your page like GoogleBot, he also visit as a normal Browser and compare versions. Since creation date is considered on ranking, what you is doing will be considered good.

    If you really want to do, do it also in your normal page, so will have less chance to being penalized, but with this will offer a worse user experience to your visitors.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥60 求一个简单的网页(标签-安全|关键词-上传)
  • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法
  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图