Skip to content

Instantly share code, notes, and snippets.

@natzir
natzir / anti-google-translate-sge-redirect.js
Created May 28, 2025 18:48
Block Google AI Overviews from hijacking your website traffic via Google Translate. Automatically redirects visitors from Google Translate SGE back to your original domain.
<script type="text/javascript">
console.log("🔍 Anti Google Translate SGE");
(function() {
const urlParams = new URLSearchParams(window.location.search);
const hasSGEParam = urlParams.has("_x_tr_pto") && urlParams.get("_x_tr_pto") === "sge";
console.log("🔍 Checking _x_tr_pto parameter:", {
hasParam: urlParams.has("_x_tr_pto"),
paramValue: urlParams.get("_x_tr_pto"),
isSGE: hasSGEParam