gpt4 book ai didi

search - 如何向搜索引擎隐藏某些文本?

转载 作者:行者123 更新时间:2023-12-02 07:17:30 25 4
gpt4 key购买 nike

在我的 WordPress 博客中,我的每篇文章都标有“Posted ? days ago”。我的主页上有 10 个帖子。因此,根据大多数关键字分析工具,“几天前”是我博客上的热门关键字,但我不希望它成为这样。如何对搜索引擎隐藏这些词?

我不想使用 JavaScript。我可以轻松使用 PHP 和 $_SERVER 变量,但我担心我可能会因隐藏内容而受到惩罚。是否有我可以使用的 HTML 标记或属性(如 rel="nofollow")?

最佳答案

来自Is there any way to have search engines not index a certain section of a page?

Supposedly you can add the class robots-nocontent to elements on your page, like this:

<div class="robots-nocontent">

<p>Ignore this stuff.</p>

</div>

Yahoo respects this, though I don't know if other search engines respect this. It appears Google is not supporting this at this time. I suspect if you load your content via ajax you would get the same effect of it not being present on the page.

There's no general way to do that and personally I wouldn't bother with it. Search engines are pretty good at recognizing relevant content on a page, and even though that content might show up in the keywords that search engines have found, it doesn't mean that it would make the page relevant for those keywords.

If you have a page about "Fish" and a page about "Dogs" (that has the link to the page about "Fish" somewhere in the sidebar), search engines will generally be able to recognize that the page about "Fish" is much more relevant for "Fish" than the page about "Dogs" that mentions "Fish" in the sidebar. It's possible that both pages might be found at some point, but generally given that mostly one page from the site is shown in the search results, that's not something worth worrying about.

There's no need to be fancy with that, and search engines are likely to just get more confused if you try (eg if you use JavaScript to hide the content, you never know when search engines will start to find that content regardless). Similarly, using iframes with robots.txt disallows or AJAX will frequently degrade the quality of your pages to users (slow it down or make it less usable on a variety of devices), so unless there is a very, very strong & proven reason that you need to do this, I would strongly recommend not bothering with it.

关于search - 如何向搜索引擎隐藏某些文本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6588438/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com