user_agents as $user_agent) {
$output .= "User-agent: $user_agent\n";
}
// Add a single Disallow rule for all User-agents
$output .= "Disallow: /\n";
// Add end comment for the block
$output .= "# ---------------------------\n# END AI Scrape Protect block\n";
return $output;
}
}
class AISP_Add_Meta_Tags {
public function __construct() {
add_action('wp_head', [$this, 'add_ai_meta_tags'], 1);
}
public function add_ai_meta_tags() {
echo "\n\n\n";
// Prevents OpenAI's GPTBot from accessing and using the content for AI model training.
echo "\n";
echo '' . "\n";
// Instructs general AI bots to avoid indexing, summarizing, or using the content for AI purposes.
echo "\n";
echo '' . "\n";
// Prevents Bing's bot from using the content for AI-related purposes, such as training language models.
echo "\n";
echo '' . "\n";
// Signals all compliant bots to avoid using the content for AI purposes, while still allowing indexing.
echo "\n";
echo '' . "\n\n";
echo "\n";
}
}
// Initialize both classes
new AISP_Manage_Robots_Txt();
new AISP_Add_Meta_Tags();