Cloaking is dead. Long live cloaking.

Cloaking is one of SEO’s oldest tricks. You show a search engine one version of a webpage, and your visitors something different. Google sees a respectable local dentist’s website, while anybody clicking through from the search results gets redirected to an online casino.

It’s a grubby practice, and one which Google has spent decades trying to detect and prevent. Quite rightly, too. Search engines ought to be able to trust that the pages they’re recommending are representative of the experience their users will encounter.

Personally, I think cloaking is a bad idea in principle, even when you’re not trying to manipulate search engines. Maintaining different versions of reality for different consumers introduces complexity, fragility, and all sorts of opportunities for things to go wrong. I’ve written before about why a page is more than just a container for words, and why maintaining separate representations for humans and machines creates problems of trust, consistency, and verification which are almost impossible to solve sustainably.

Unfortunately, cloaking is fashionable again.

The rise of AI search and LLM-powered agents has given the industry a fresh appetite for serving different things to different consumers. There’s growing enthusiasm for machine-specific versions of webpages, often stripped down to Markdown or otherwise ‘optimised’ for AI consumption.

Some of this is well-intentioned, if architecturally questionable. Others are experimenting with detecting AI crawlers by their user agents, serving them specially tailored responses, or embedding instructions into webpages which attempt to manipulate what agents think, say, or recommend. New technology, same old SEO nonsense.

But while everybody’s rediscovering the joys of serving different content to different consumers, I think there’s something considerably more interesting happening at the edges of Google’s traditional definition of cloaking.

Because Google’s own crawler has spent years browsing websites in ways which ordinary humans never would. And some of those differences could, theoretically, allow you to show Google a completely different website from the one your visitors see, without ever detecting Googlebot, changing the HTML response, or doing any of the things we’ve traditionally associated with cloaking.

All you’d need is a little CSS.

Google’s strange mobile browser

In 2016, Google announced that it was moving towards mobile-first indexing, a process which it eventually completed in July 2024. Rather than primarily crawling websites as a desktop browser, Google would increasingly use a smartphone crawler and treat the mobile version of a website as the basis for indexing.

That makes sense. Most people browse the web on mobile devices, and responsive websites routinely adapt their layouts, navigation, imagery, and sometimes even their content to suit different screen sizes.

But Google’s mobile browser isn’t quite like yours.

For years, Google’s rendering infrastructure has used unusually tall viewports. Back in 2017, John Mueller suggested experimenting with a viewport around 9,000 pixels tall to approximate Google’s rendering behaviour.

Those are rather peculiar dimensions for something pretending to be a smartphone. Most phones have viewport heights measured in hundreds of CSS pixels, not thousands. That’s significant, because browsers make all sorts of decisions based on the dimensions of their viewport.

If you’re familiar with responsive design, you’ll know that CSS media queries let developers change how a page looks depending on the characteristics of the device or browser displaying it. Usually, we’re interested in width. A narrow screen gets a single-column layout, perhaps with a hamburger menu, while a wider screen gets something more elaborate.

But media queries can also respond to height, aspect ratio, orientation, colour preferences, and various other environmental conditions.

So, theoretically, you could write a perfectly ordinary CSS media query like @media (min-height: 9000px) and use it to change the appearance of a website when the browser’s viewport is unusually tall.

Now imagine taking that a little further.

What if the rules which match a particularly tall viewport revealed one set of content, while the rules which match a normal viewport revealed something else entirely?

Perhaps Google sees our respectable dentist’s website, while ordinary visitors see the casino.

The server hasn’t identified Googlebot. It hasn’t served a different response. There are no suspicious user-agent checks, special redirects, or alternative templates. Both visitors receive exactly the same HTML and CSS, and their browsers simply interpret those resources differently.

And that’s the interesting bit. We could theoretically produce something which looks like traditional cloaking, using nothing more exotic than responsive design.

I’m not suggesting that Google reliably uses any particular viewport height, or that this would work as a dependable way to identify its renderer. It might not even trigger under the conditions we’d expect, and Google’s configuration and rendering processes are subject to change. Nor should we assume that Google is incapable of inspecting CSS or testing different viewport dimensions.

But those are questions about whether this would work as an exploit. I’m more interested in the underlying principle.

If two browsers can receive identical resources and construct radically different experiences, which of those experiences is the ‘real’ webpage?

And how does Google distinguish legitimate responsive behaviour from something designed specifically to deceive it?

The browser can do some peculiar things

Changing the visibility of existing HTML through CSS is only one way to produce different experiences from the same underlying document.

CSS can also generate content.

The content property, commonly used with ::before and ::after pseudo-elements, allows developers to insert text and other visual material into the rendered presentation of a webpage.

Usually, that’s something decorative. An icon, a quotation mark, a label, or some other small embellishment which doesn’t warrant a dedicated HTML element.

But there’s nothing stopping somebody from putting more substantial text into those properties. And that text can appear visually on the page, even though it doesn’t exist as an ordinary text node in the document’s DOM.

Here’s where things get peculiar. Google explicitly advises against relying on CSS-generated text for indexing, because content generated through the CSS content property isn’t part of the DOM, and Google Search currently ignores it.

Which means that a human can look at a webpage and read words which Google doesn’t necessarily consider to be part of the page’s textual content.

The browser paints them on screen. They’re quite literally visible. But the search engine may ignore them when constructing its understanding of what the document contains.

That’s already an interesting discrepancy, even without any attempt at deception. Now combine it with viewport-dependent media queries, and you have another way in which the visual experience can differ from the information Google extracts.

The same principle applies, in different ways, to responsive imagery.

HTML’s <picture> element allows developers to define multiple image sources, with media conditions determining which image a browser should display. It’s a perfectly legitimate mechanism for art direction, where a portrait crop might be more appropriate on mobile than a wide landscape image.

But those media conditions don’t have to select different crops of the same image. They could select images with completely different subjects.

Imagine that the image Google discovers or associates with a page isn’t the one most visitors actually see. Or that Google’s unusually tall rendering environment selects a different image from the one displayed on an ordinary phone.

Again, there’s no need to detect Googlebot or serve it a special HTML response. The browser makes the decision, based on the conditions in which it’s operating.

Of course, Google’s image discovery and indexing systems don’t necessarily operate in the same way as its visual renderer. The image which appears in a screenshot isn’t automatically the image which Google indexes, or even the one it considers most representative of the page.

And that’s part of the problem. We’re dealing with several overlapping interpretations of the same resource, and there’s no guarantee that they all agree.

It gets stranger when we move beyond presentation and start considering how Google’s browser actually executes code.

In an excellent experiment published in July 2026, Dave Smart demonstrated that Google’s Web Rendering Service (WRS), which processes JavaScript and renders pages for indexing, handles time rather differently from a conventional browser.

His tests showed that WRS could effectively pause its virtual JavaScript clock while waiting for network requests to complete. Pages could perform asynchronous operations which took considerably longer in real time than the few seconds reported by JavaScript timers.

That matters because modern websites routinely use timers, asynchronous requests, and other JavaScript behaviours to decide what to display and when. If Google’s rendering environment experiences those operations differently from an ordinary browser, it may encounter a different state of the page, even when executing exactly the same code.

And all of this is happening before we consider cookies, session state, user interactions, browser permissions, personalisation, or any of the thousands of other environmental factors which influence how modern websites behave.

We’ve built a web where the same URL can produce wildly different experiences depending on the browser, device, viewport, environment, and circumstances in which it’s accessed.

Yet we still talk about cloaking as though there’s a single, objective version of a page against which everything else can be compared.

So, is this cloaking?

Well, yes. Probably. Depending on what you’re trying to achieve.

Google’s spam policies define cloaking as presenting different content to users and search engines with the intent to manipulate rankings and mislead users.

That’s a sensible definition, because it focuses on the intent rather than prescribing which technical mechanisms constitute a violation.

If you’re deliberately arranging for Google to see a legitimate dentist’s website while users encounter a casino, you’re pretty clearly violating the spirit, and almost certainly the wording, of those policies.

It doesn’t particularly matter whether you’ve achieved that through PHP, JavaScript, CSS, or some elaborate combination of responsive images and browser features. The fact that the server returns identical HTML doesn’t magically make deception acceptable.

And Google’s detection capabilities aren’t limited to comparing HTTP responses, either. It can inspect resources, evaluate rendered content, and potentially test pages under different conditions. There’s no reason to assume that a clever media query is invisible to its systems.

But that still leaves us with an awkward problem.

Because if we’re going to define cloaking as presenting different content to search engines and users, we need some way of distinguishing deliberate deception from the entirely normal differences produced by modern web technologies.

A responsive navigation menu is fine. A mobile-specific hero image is fine. A desktop layout which contains more information than its mobile equivalent is generally fine.

What about an A/B test which displays substantially different content to different visitors? Or a JavaScript application which displays different information depending on whether the browser has previously visited the website? What about a component which only loads after somebody scrolls, interacts, or waits?

Or a page which Google renders differently because its browser has an unusually tall viewport, or because its rendering infrastructure experiences the passage of time differently?

At what point does an ordinary difference in rendering become a misleading difference in content?

I don’t think there’s a particularly satisfying technical answer to that question. And I suspect that’s why Google’s definition focuses on intent.

But intent is a slippery thing to infer from code, particularly when that code is doing things which are perfectly legitimate in other circumstances.

A media query which changes an image based on viewport dimensions is ordinary responsive design. A media query which exists specifically to make Google see something misleading is cloaking. The browser doesn’t know the difference, and the CSS syntax doesn’t reveal the author’s motivation.

Which version of the page is real?

I think this exposes a broader problem with how we think about websites.

We still tend to treat a webpage as though it’s a discrete, stable object. Something which exists at a URL, which a browser retrieves, and which a search engine can inspect and evaluate.

But I’ve written before about how the web isn’t really URL-shaped anymore, and why the systems which consume it increasingly care about the information and relationships within our documents, rather than the documents themselves.

Cloaking exposes another dimension of that problem. Because even before a search engine can decide what a page means, it has to determine what the page actually is.

The HTML response might contain one thing, the post-JavaScript DOM another, and the rendered presentation something else entirely. Then the search engine has to extract, interpret, and evaluate those things to construct its own understanding of the resource.

Different consumers might encounter different representations, follow different paths through the rendering process, and arrive at different conclusions. Some won’t execute JavaScript. Some won’t interpret CSS. Some might retrieve alternative representations, consume structured data, or extract text from the raw HTML without ever constructing anything resembling a visual webpage.

Which makes the traditional idea that we should simply ‘show search engines what users see’ rather less useful than it sounds.

What does a user see? Which user? On which device? Under which conditions? At what point in the page’s lifecycle?

And which of those experiences should a search engine consider authoritative?

I don’t think the answer is to build increasingly elaborate systems for identifying consumers and tailoring content to their expectations. Quite the opposite. That’s an architectural dead end, and one which will only become more expensive as the number and variety of consumers increases.

The more sensible approach is to make our underlying documents, content, and semantics as robust and consistent as possible, and let browsers adapt their presentation to the needs of their users.

That’s what the web is supposed to be good at.

It’s also why I’ve argued that semantic HTML still matters. A meaningful, accessible, well-structured document gives all of these different consumers something reliable to interpret, regardless of whether they render it, parse it, or interact with it.

That doesn’t guarantee that they’ll all construct the same experience. But it gives them a shared foundation to work from, without requiring us to build and maintain a separate version of reality for every new browser, crawler, or agent which comes along.

And it means accepting that the difference between legitimate adaptation and malicious cloaking is increasingly a question of intent, rather than something we can reliably identify through a simple comparison of two versions of a page.

I’m still firmly against cloaking. I think deliberately misleading search engines and users is a shitty way to build a website, and an even worse way to build a sustainable business.

But I’m increasingly fascinated by how much the modern web allows us to appear to cloak, without ever doing any of the things we’ve traditionally associated with cloaking.

No special user agents. No alternative server responses. No redirects. Just ordinary browser features, doing exactly what they’re designed to do.

And perhaps the strangest part is that the more faithfully browsers implement those features, the more difficult it becomes to insist that there’s one definitive version of a webpage.

There might never have been one in the first place.

0 Comments