wp_robots

過濾鉤子
apply_filters( 'wp_robots', array()
引數
  • (array) $robots Associative array of directives. Every key must be the name of the directive, and the corresponding value must either be a string to provide as value for the directive or a boolean `true` if it is a boolean directive, i.e. without a value.
    Required:
定義位置
相關勾子
do_robotswp_footerwp_logoutwpmu_optionswpmu_drop_tables
相關方法
wp_robotswp_no_robotsdo_robotsis_robotswp_roleswp_robots_noindex
引入
5.7.0
棄用
-

wp_robots:這是一個 WordPress 函式,用於生成 robots.txt 檔案。這個檔案可以告訴搜尋引擎爬蟲那些頁面可以抓取,那些頁面不可以抓取。生成的 robots.txt 檔案通常儲存在網站根目錄中,可以通過向網站根目錄 URL 新增 /robots.txt 訪問。

過濾要包含在’robots’元標籤中的指令。

元標籤將只在必要時被包含。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
$robots = apply_filters( 'wp_robots', array() );
$robots = apply_filters( 'wp_robots', array() );
$robots = apply_filters( 'wp_robots', array() );

常見問題

FAQs
檢視更多 >