mhung2502
Forum Replies Created
-
@tech0 I have found another better way to fix this. You can use the Redirection plugin (https://ww.wp.xz.cn/plugins/redirection/) and add the following 2 redirect rules:
Source URL: ^/\?wordfence_lh=1&hid=.*
Type: Regex
Target URL: /
*(only slash, this will redirect the URL to your homepage)Source URL: ^/(.*?)/\?wordfence_lh=1&hid=.*
Type: Regex
Target URL: /$1/This will work like a champ! Hope this helps.
Hey guys, I experienced the same issue. It caused hundreds of duplicate pages on my website.
Here’s how I successfully fixed it. I added the following code to my theme’s functions.php file.
/**
* Redirect Wordfence URLs
*/
if (isset($_GET[‘wordfence_lh’]) && $_GET[‘wordfence_lh’] == 1) {
status_header(301);
header(“Location: /”, true, 301);
exit;
}This simply redirects all URLs with “wordfence_lh” to the homepage. I also blocked the google bot from crawling these pages for several weeks until the problem is resolved.
Put this into robots.txt:
Disallow: /?wordfence_lh=1
Once the issue is fixed, you can remove this from the robots.txt file.
Hope this helps.