2

On our site we use a plugin that uses the IP2Nation module to detect the country of the visitor.

We then output amended content if the site is viewed from abroad - so instead of encouraging visitors to view the showroom, we tell them that we export worldwide.

The thing is, I've just discovered that Google's cached versions of pages are the Export version.

So my question is... Is it possible to detect if a 'visitor' is a bot - preferably as an if statement. We could then surround the export checking if statements with a bot checker first, so that bots don't trigger the export version, but real people do.

2 Answers 2

1

You can use php to attempt to detect a bot, and dynamically show the desired content based on the results. Not perfect, but may help with your case. Check out this add-on https://devot-ee.com/add-ons/detect-spider for ee2 and maybe you could modify for ee3 if needed.

0

This is a different approach then what you are asking for, but consider adding the noindex meta tag to the version you do not want indexed.

<meta name="robots" content="noindex">

OR

<meta name="googlebot" content="noindex">

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.