Google’s John Mueller tells SEOs that fake Lighthouse scores won’t help websites rank any higher in search results.
For business owners, be weary of anyone selling a service that promises to boost your SEO by tricking Lighthouse.
Mueller addressed this on Twitter after a Shopify performance engineer named Colin Bendell brought attention to the issue.
From the sounds of it, it’s possible Shopify partners are selling “SEO boosters” that claim to boost rankings by cheating Lighthouse.
In addition to not ranking any higher in search results, the Shopify engineer warns of consequences for selling such a service.
“It makes me angry when I see devs intentionally selling snake oil to entrepreneurs
Let me be clear: Any Shopify partner selling “SEO boosters” that cheat lighthouse scores and hurt the buyer experience is violating the AUP&PPP. There will be consequences
You have been warned”
In a previous tweet he shows an example of how developers are trying to fool Google with fake Lighthouse scores.
There is a special place in hell for people that add UA checks for 'Chrome-Lighthouse' and then use document.write()
This is not tricking SEO ranking. Only hurting your business. pic.twitter.com/iFFfTsnar2
— Colin Bendell (@colinbendell) August 4, 2021
This code directs the website to recognize when Lighthouse is running a test on it.
If the ‘userAgent’ detects ‘Chrome-Lighthouse’ then ‘document.write()’ is triggered. This wipes the page that just loaded and starts writing something new.
As a result, Lighthouse doesn’t get an accurate reading of the website’s score, which is thought to have a positive impact on SEO. Presumably because it disguises bad scores.
I reached out to Mr. Bendell for further insight into why the use of ‘document.write()’ is a bad practice. He tells me:
“It forces the browser to halt all activity and inject the page with the content. As a result the browser can’t continue to look ahead at the page to see if it needs to load other images or javascript because it could radically change based on what the document.write() does.
… the use of document.write() obfuscates its contents and is a common way for nefarious code to be injected.
The issue is that the if condition (if window.navigator.userAgent !== Lighthouse) basically omits all the scripts and css and other clutter. It makes the page really fast for lighthouse.”
Although Lighthouse may think it’s testing a super fast site, Google won’t be swayed. Here’s what Mueller has to say about this tactic.
Google’s John Mueller on Fake Lighthouse Scores
Whether genuine or fabricated, Lighthouse scores are not used by Google to rank webpages.
In fact, user-agent cloaking may lead to a negative impact on SEO because it prevents you from finding the real problems on your website.
Mueller says:
“Lighthouse scores do not affect Google Search.
Doing this kind of user-agent cloaking is a terrible idea – you’re just deceiving yourself. It makes absolutely no sense, and prevents you from finding real issues. If you run across a plugin that does this, report it to the CMS.”
Lighthouse is intended to be used as a developer tool. The scores it generates are based on lab data, which is why it has no impact on search.
When looking at ranking factors such as page speed and core web vitals, Google evaluates them using field data.
Field data is collected from real users, versus lab data which is produced via a controlled test.
Google prefers to use field data because it’s a more accurate reflection of the user experience.
Lighthouse scores are irrelevant to Google, but they can help with identifying and fixing SEO issues.
However, that’s only true if the site can be tested properly, which isn’t possible with user agent cloaking in place.
Tricking Lighthouse Leads to Worse SEO
Shopify’s Bendell adds that this technique may load pages fast for Lighthouse, but actual visitors will experience worse performance:
“… the code snippets I shared in the tweet are making things faster for lighthouse, but ironically, making things slower for real humans. And since SEO is based on real human performance (using CrUX data), the irony is that the so-called speed up is making the human experience slower and thus decreasing your SEO.”
Google warned developers against the use of document.write() back in 2016, explaining the negative impact it has on page performance:
“… scripts dynamically injected via
document.write()
can delay the display of main page content for tens of seconds, or cause pages to either fail to load or take so long that the user just gives up.”
The key takeaway here is don’t attempt to trick Lighthouse and don’t get taken by anyone trying to sell this to you as a service.
More resources:
- A Technical SEO Guide to Lighthouse Performance Metrics
- Google PageSpeed Scores Updated with Lighthouse 8.0
- Google: Lighthouse Measures How Fast a Site Loads for Actual Users
Featured Image: Romolo Tavani/Shutterstock