大网数据广告活动
网站运营与故障问答

Can I have only homepage URL inside sitemap.xml?

· 52CE 我爱测

Can I have only homepage URL inside sitemap.xml ? I want to cancel Google to crowling and indexing any other page. here is the code of my current sitemap.xml : <?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.site…

问题原文

原帖链接 · provance · CC BY-SA 4.0

Can I have only homepage URL inside sitemap.xml? I want to cancel Google to crowling and indexing any other page.

here is the code of my current sitemap.xml:

<?xml version="1.0" encoding="UTF-8"?>
<urlset
      xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
            http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
        
<url>
  <loc>https://gpj.rs/</loc>
  <lastmod>2022-09-24T07:00:53+00:00</lastmod>
</url>
</urlset>

已采纳解答

原帖链接 · Stephen Ostermiller · CC BY-SA 4.0

Google doesn't limit crawling to just the URLs you put in your XML sitemap. Sitemaps are only one source of crawling data. Googlebot also crawls URLs when it finds links to them. If your home page contains links to other pages, Googlebot will find those other pages and crawl them whether or not they are in the sitemap.

Furthermore, once Googlebot crawls a URL, it will remember it forever. It will continue come back and fetch that URL periodically, even a decade or more after the content has been removed from it. Removing a page from your sitemap won't stop Googlebot from crawling or indexing the page.

Having Google index only your home page is a horrible SEO strategy. Most sites get only a small fraction of their search engine traffic coming into their home page. Google directs the majority of searchers deep into sites to specific content that matches the keywords they search for. If your goal is to get visitors from search engines, you should let Googlebot crawl and index all the content that would be relevant to searchers.

If you want Googlebot to stop crawling URLs, you need to list them in robots.txt with a Disallow: rule. However, that won't completely stop Google from indexing the pages. Google occasionally indexes pages that are blocked in robots.txt when it finds enough external links to them.

If you totally want the pages removed from Google, you should allow them to be crawled by Googlebot, but show an error, or explicitly tell Google not to index them using a robots meta tag.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Webmasters Stack Exchange
适用范围
以原帖系统、软件版本与发布日期为准(2022-09-24)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。