In the world of SEO optimization, two small files often make a big difference: robots.txt and sitemap.xml.Although simple, they play a crucial role in determining whether search engines can successfully crawl and index your website. This article uses a real-world example — https://www.nuface.tw/, running WordPress 6.8.3 with the SureRank SEO Plugin — to explain how…
Category: WordPress
About WordPress
如何正確設定 WordPress 的 robots.txt 與 Sitemap(以 SureRank 為例)
在網站 SEO 優化的過程中,常聽到兩個關鍵字:robots.txt 與 sitemap.xml。這兩個檔案雖然簡單,卻是影響搜尋引擎能否順利索引網站內容的重要關鍵。本文以實際案例(網站:https://www.nuface.tw/、使用 WordPress 6.8.3 + SureRank SEO Plugin)說明設定方式與常見錯誤排除方法。 一、robots.txt 是什麼? robots.txt 是放在網站根目錄下的文字檔,用來告訴搜尋引擎哪些內容可以被爬取(crawl),哪些不行。這個檔案不會影響網站運作,但會影響 Google、Bing 等搜尋引擎的收錄行為。 📂 位置: 🧱 功能: 二、WordPress 建議版 robots.txt 若你的網站使用 WordPress(例如 SureRank、Yoast、Rank Math 等 SEO 外掛),建議使用以下設定: 三、SureRank Sitemap 設定說明 SureRank 會自動產生一個「索引型 Sitemap(sitemap index)」:👉 https://www.nuface.tw/sitemap_index.xml 此檔案內包含多個子 sitemap,例如: 搜尋引擎只需讀取最上層的 sitemap_index.xml,即可自動遞迴讀取下層 sitemap,因此在 robots.txt 中只需列出一行即可。 四、常見錯誤:首頁無法被索引(Homepage not indexable) 在 SureRank 的 Site Analysis 中,有時會看到如下警示訊息:…
【WordPress Tips】Show “Login / Logout” Dynamically in the Frontend Menu (Supports Ultimate Member Plugin)
In my WordPress site, I wanted the navigation menu to display “Login” when users are not logged in, and automatically change to “Logout” after login.Here’s how I achieved it — a clean and simple solution that works perfectly with the Ultimate Member plugin. 🎯 Goal 🧱 Method 1: Use a Placeholder Menu Item Step 1:…
【WordPress 筆記】前端選單動態切換登入/登出(支援 Ultimate Member 外掛)
在 WordPress 網站的導覽列中,我希望使用者未登入時顯示「登入」,登入後則自動變成**「登出」**。以下記錄整個設定過程,方便日後備查。 🎯 實現目標 🧱 方法一:在選單中加入佔位項目 Step 1:建立選單項目 到 外觀 → 選單新增一個自訂連結: 儲存選單。 Step 2:加入下列程式碼 將以下程式碼貼到主題的 functions.php 或用「Code Snippets」外掛執行。 🧩 如何找到 Ultimate Member 的登入頁 URL 💡 其他建議 🚀 結論 這個方法簡單又穩定,不需額外外掛即可實現: 📌 延伸參考