透過集合功能整理內容
你可以依據偏好儲存及分類內容。
執行網頁偵錯
通則
提醒您,Google 不會在您發布修正後立即檢索網頁。因此,您修正的網頁在 Search Console (和 Google 搜尋) 上仍可能會持續顯示有錯誤,直到 Google 再次檢索該網頁。或者您也可以要求加速檢索 (例如使用網址檢查工具),不過大部分情況下只需要幾天的時間,檢索器應該就會發現網頁有所更新。
以下列出幾個實用的工具,協助您進行網頁偵錯。
您必須是網頁所屬網站的已驗證使用者,才能在網頁或網站中使用以下工具和報告。這是因為 Search Console 會提供機密的網站資料,而這些資料只有已通過驗證的網站使用者才能存取。
-
Search Console:註冊 Search Console 並驗證網站的擁有權之後,即可使用下列各項實用的網站監控和測試工具。
-
複合式搜尋結果狀態報表:本文將說明 Google 能否在您的網站中讀取特定複合式搜尋結果,以及提供相關錯誤的疑難排解資訊,並讓您瞭解如何在修正問題後提出重新檢索要求。您不能使用這項工具來測試任意網址。
-
網址檢查工具:瞭解您的網頁如何顯示在 Google 索引中,並對線上網址執行索引測試,以及查看 Google 如何算繪您的網頁和提交要建立索引的網址。
-
robots.txt 報表:確認 Google 是否能處理您的 robots.txt 檔案。您也可以要求 Google 在緊急時重新檢索 robots.txt 檔案。
-
AMP 狀態報告:查看 Google 在整個網站上偵測到的 AMP 網頁錯誤。錯誤是 Google 在進行定期檢索時偵測到的,您無法測試任意網址。
這些工具可用於任何網址,不需要網站的 Search Console 權限。
有些工具還能讓使用者將程式碼片段貼到工具內。
如果您的網址設有防火牆或由本機電腦代管,可利用通道解決方案將網頁提交給測試工具。瞭解如何測試本機代管或設有防火牆的網頁。
如需其他資源和諮詢時間等相關資訊,請參閱我們的說明頁面。
測試本機代管或設有防火牆的網頁
Google 提供多項測試工具讓您測試單一實際網頁,例如 AMP 測試工具和複合式搜尋結果測試。不過,就算您的網頁是在本機電腦上執行 (沒有公開網址) 或者設有防火牆保護,您只要向測試工具開放通道,還是可以測試網頁。無論您是想在正式發布到網路前先測試網頁,或在發布程序中加入這項測試步驟,這個功能都非常實用。
如要測試本機網頁或有防火牆保護的網頁,請使用 ngrok
等通道解決方案。這些工具能提供公開網址,連結至您存在本機主機或防火牆保護伺服器中的非公開網頁。
以下範例是先啟動 Python 的 SimpleHTTPServer
,接著以本機電腦代管網頁,然後使用 ngrok 為這個網頁產生可供公開存取的網址:
步驟 1
啟動本機 HTTP 伺服器,將您的網頁置於指定連接埠。我們在以下範例中指定的連接埠是 5326
。
SimpleHTTPServer
會將目前的目錄對應為網站的根網頁。
python3 -m http.server 5326
Serving HTTP on 0.0.0.0 port 5326
...
步驟 2
在另一個終端機中,啟動本機 ngrok
應用程式,並監聽我們在步驟 1 開啟的通訊埠 5326
。
./ngrok http 5326 --request-header-add ngrok-skip-browser-warning:1
ngrok by @inconshreveable (Ctrl+C to quit)
Session Status online
Version 2.2.4
Region United States (us)
Web Interface http://127.0.0.1:4040
Forwarding http://ad0a5735.ngrok.io -> localhost:5326
Forwarding https://ad0a5735.ngrok.io -> localhost:5326
Connections ttl opn rt1 rt5 p50 p90
0 0 0.00 0.00 0.00 0.00
步驟 3
將 ngrok 產生的網址傳送至您選用的測試工具。
這個範例中的根網址是 http://ad0a5735.ngrok.io
,因此如果網頁是儲存在本機的 ~/testwebdir/mypage.html
,然後從 ~/testwebdir/
啟動上述伺服器,就可以測試 http://ad0a5735.ngrok.io/mypage.html
。您可以在複合式搜尋結果測試中直接貼上該網址,或是前往 https://search.google.com/test/rich-results/result?url=http%3A%2F%2Fad0a5735.ngrok.io%2Fmypage.html
。
請注意,視本機主機和通道解決方案的不同,對應網頁的方式也會有所差異。
此外,部分通道解決方案 (不包括 ngrok) 會利用 robots.txt 自動保護您的暫時公開網址,導致您無法對這些網頁進行 Google 測試;因為 Google 測試工具會顧及 robots.txt 的限制。詳情請參閱各通道解決方案及網站代管軟體的說明文件。
排除存取錯誤
如果您在使用 Google 測試工具時遇到存取錯誤,請按照以下步驟除錯:
- 確認網頁未受到 robots.txt 保護,而且存取時無須登入。
- 嘗試在另一台電腦或使用 Chrome 無痕模式從防火牆外存取您的網頁。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-08-04 (世界標準時間)。
[null,null,["上次更新時間:2025-08-04 (世界標準時間)。"],[[["\u003cp\u003eGoogle Search and Search Console may display errors even after you've fixed them, as crawling isn't immediate and can take a few days for changes to be reflected.\u003c/p\u003e\n"],["\u003cp\u003eUtilize various Google testing tools like the URL Inspection tool or Rich Results Test to debug and understand how Google perceives your pages.\u003c/p\u003e\n"],["\u003cp\u003eFor pages behind firewalls or hosted locally, use tunneling solutions like \u003ccode\u003engrok\u003c/code\u003e to expose them for testing with Google's tools.\u003c/p\u003e\n"],["\u003cp\u003eWhen facing access errors during testing, ensure your page isn't blocked by robots.txt, login requirements, or firewall restrictions.\u003c/p\u003e\n"],["\u003cp\u003eSearch Console offers valuable site monitoring and testing tools but requires site ownership verification for access to confidential data.\u003c/p\u003e\n"]]],["Google offers various tools for debugging web pages. Search Console, requiring site verification, provides tools like Rich Result status reports and the URL Inspection tool for in-depth analysis and recrawl requests. Anonymous tools, such as the AMP and Rich Results Tests, are available for any URL. To test locally-hosted or firewalled pages, utilize tunneling solutions like ngrok to create a public URL. If facing access errors ensure your page is not blocked by robots.txt and try accessing from another network or incognito mode.\n"],null,["# Debug Your Website Pages | Google Search Central\n\nDebugging your pages\n====================\n\nGeneral tips\n------------\n\n\nRemember that Google does not crawl your page immediately after you publish a fix. Therefore\n[Search Console](https://search.google.com/search-console) (and Google Search) can\ncontinue to show an error for a page that you have fixed\nuntil the page is crawled again. You can sometimes request an expedited crawl, for example\nusing the [URL Inspection](https://support.google.com/webmasters/answer/9012289)\ntool, but in most cases it takes a few days to notice changes in your pages.\n\nUseful testing tools\n--------------------\n\n\nHere are some useful tools to help you debug your pages.\n\n### Verified site owner tools\n\n\nThe following tools and reports require you to be a\n[verified site user](https://support.google.com/webmasters/answer/9008080)\nfor the page in order to use this tool on that page or site. This is because Search Console\nprovides confidential site data that only a verified site user should have access to.\n\n- [Search Console](https://search.google.com/search-console) - Sign up for Search Console and [verify ownership of a site](https://support.google.com/webmasters/answer/9008080) to get access to useful site monitoring and testing tools, such as those listed below.\n- [Rich result status reports](https://support.google.com/webmasters/answer/7552505) - Learn which rich results Google could or couldn't read from your site, get troubleshooting information for rich result errors, and request a recrawl after you have fixed any problems. You cannot test an arbitrary URL using this tool.\n- [URL Inspection tool](https://support.google.com/webmasters/answer/9012289) - Learn how your page appears in the Google index, run an index test on a live URL, and see how Google renders your page, and submit a URL for indexing.\n- [Robots.txt report](https://support.google.com/webmasters/answer/6062598) - Check whether Google can process your robots.txt files. You an also request a recrawl of a robots.txt file for emergency situations.\n- [AMP status report](https://search.google.com/search-console/amp) - See AMP page errors for your entire site detected by Google. Errors are detected during the regular crawl; you cannot test an arbitrary URL.\n\n### Anonymous tools\n\n\nThese tools can be used on any URL without needing Search Console permissions on the website.\nSome tools also allow code snippets pasted into the tool itself.\n\n\nIf your URL is behind a firewall, or is hosted on a local computer, you can use a tunnelling\nsolution to expose your page to the testing tool. [Learn how to test locally-hosted or firewalled pages.](#testing-firewalled-pages)\n\n- [AMP Test Tool](https://search.google.com/test/amp) - Test the validity of a specific AMP URL in real time.\n- [Rich Results Test](https://search.google.com/test/rich-results) - Test the validity of a structured data block in real time. The code can either be pasted into the tool, or hosted on a live page.\n\n### More tools\n\n\nSee [our help page](/search/help) for more resources and office hours information.\n\nTesting locally-hosted or firewalled pages\n------------------------------------------\n\n\nGoogle provides several testing tools to test a single live web page. For example, the\n[AMP Test Tool](https://search.google.com/test/amp) and the\n[Rich Results Test](https://search.google.com/test/rich-results).\nHowever, if your page is running on your local machine without a public\nURL, or if it is hosted behind a firewall, you can still test the page by exposing a tunnel to\nyour page for the testing tool.\nThis can be useful if you want to test a page before making it publicly available on the web,\nor even as another step in your release process.\n\n\nTo test a local or firewalled page, use a tunneling solution such as `ngrok`. These\ntools provide a public URL that connects to a non-public page on your local host or firewalled\nserver.\n\n\nThe following example first starts up python's\n[`SimpleHTTPServer`](https://docs.python.org/2/library/simplehttpserver.html)\nto host a page on the local computer, then uses\n[ngrok](https://ngrok.com/) to expose that page on a\npublicly-accessible URL:\n\n**Step 1**\n\n\nStart up a local HTTP server to host your page on a given port. For our example we chose port\n`5326`.\n\n\n`SimpleHTTPServer` maps the current directory as the site root. \n\n python3 -m http.server 5326\n Serving HTTP on 0.0.0.0 port 5326\n ...\n\n\n**Step 2**\n\n\nOn another terminal, start up your local `ngrok` app, listening to port\n`5326`, which we opened in step 1. \n\n ./ngrok http 5326 --request-header-add ngrok-skip-browser-warning:1\n ngrok by @inconshreveable (Ctrl+C to quit)\n\n Session Status online\n Version 2.2.4\n Region United States (us)\n Web Interface http://127.0.0.1:4040\n Forwarding http://ad0a5735.ngrok.io -\u003e localhost:5326\n Forwarding https://ad0a5735.ngrok.io -\u003e localhost:5326\n\n Connections ttl opn rt1 rt5 p50 p90\n 0 0 0.00 0.00 0.00 0.00\n\n\n**Step 3**\n\n\nPass your exposed ngrok URL to the test tool of your choice.\n\n\nThe root URL in our example is `http://ad0a5735.ngrok.io`, so if our page is saved\nlocally at `~/testwebdir/mypage.html`, and we started the server above from\n`~/testwebdir/`, we could test `http://ad0a5735.ngrok.io/mypage.html`.\nIn the Rich Results Test, you could paste that URL in directly, or visit\n`https://search.google.com/test/rich-results/result?url=http%3A%2F%2Fad0a5735.ngrok.io%2Fmypage.html`.\n\n\nNote that different local hosts and tunneling solutions map your pages differently.\n\n\nAlso, some tunneling solutions (not ngrok) automatically protect your temporary public URL\nwith robots.txt, which will prevent you from running Google tests on them. Google testing\ntools respect robots.txt. Read the documentation for your tunneling solution and web hosting\nsoftware.\n\n### Debugging access errors\n\n\nIf you get an access error using a Google testing tool:\n\n- Check that your page isn't protected by robots.txt and doesn't require a login.\n- Try accessing your page from outside your firewall, on another computer, or using Chrome in Incognito mode."]]