What do you guys put into your robots.txt to prevent search engines from indexing:
xxx.com/?tracking=***
AND
xxx.com/?coupon=***
PS I think below works, but I can't really use it because I use /?tracking=** in my google ads and I think this gets my ads disapproved.
Disallow: /*?tracking
Disallow: /*&tracking
xxx.com/?tracking=***
AND
xxx.com/?coupon=***
PS I think below works, but I can't really use it because I use /?tracking=** in my google ads and I think this gets my ads disapproved.
Disallow: /*?tracking
Disallow: /*&tracking
Last edited by supak111 on Tue Feb 25, 2025 10:17 pm, edited 1 time in total.
~ OC 3.0.3.2 and OCmods only ~
use html meta tagssupak111 wrote: ↑Mon Feb 24, 2025 1:44 amWhat do you guys put into your robots.txt to prevent search engines from indexing:
xxx.com/?tracking=***
AND
xxx.com/?coupon=***
PS I think below works, but I can't really use it because I use /?tracking=** in my google ads and I think this gets my ads disapproved.
Disallow: /*?tracking
Disallow: /*&tracking
Code: Select all
<meta name="robots" content="noindex, follow">
Code: Select all
header("X-Robots-Tag: noindex, follow", true);
Using the headers is tough to do because multiple pages share the same header file.
In robots.txt
User-agent: *
Disallow: /*?tracking
Disallow: /*?coupon
You should also be able to use this if you want to block all URLs that have /? in it
User-agent: *
Disallow: /*?
And then use Google's robots.txt testing tool to make sure:
https://www.google.com/webmasters/tools ... sting-tool
In robots.txt
User-agent: *
Disallow: /*?tracking
Disallow: /*?coupon
You should also be able to use this if you want to block all URLs that have /? in it
User-agent: *
Disallow: /*?
And then use Google's robots.txt testing tool to make sure:
https://www.google.com/webmasters/tools ... sting-tool
ELEV8TE Website Development
Available for hire - please contact me at https://www.elev8tewebsitedevelopment.com/contact
https://www.elev8tewebsitedevelopment.com
You can set the noindex in htaccess.
Code: Select all
<If "%{QUERY_STRING} =~ m#(tracking|coupon)=#i">
Header set X-Robots-Tag "noindex"
</If>
That works greatADD Creative wrote: ↑Mon Feb 24, 2025 11:24 pmYou can set the noindex in htaccess.
Code: Select all
<If "%{QUERY_STRING} =~ m#(tracking|coupon)=#i"> Header set X-Robots-Tag "noindex" </If>

I tried using FilesMatch but couldn't get it work
.
~ OC 3.0.3.2 and OCmods only ~
So shall we consider this issue [SOLVED]?
UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk
Who is online
Users browsing this forum: Mariogs and 82 guests