I'll say it boldly:
Text-to-HTML ratio is a bad metric that has no place in SEO.
If you're using Text-to-HTML ratio as a "warning flag" to pick out pages to take a closer look at, that's one thing. But it's not correct to say that the metric reliably points out "bad pages" - there are plenty of valid reasons a page could have low Text-to-HTML ratio.
Two much better metrics are total page weight and page load time (including time-to-first-paint, time-to-interactive, and other sub-metrics). I'll go through the points from the semrush article and rebut them one by one.
For example, a low text-to-HTML ratio can be a sign of:
- A poorly coded website (with invalid code and excessive Javascript, Flash and inline styling)
A low text-to-HTML ratio can be a sign of a poorly coded website, but it can also be a sign of:
- A web page that is not text-centric (like a web tool, for instance)
- A web page that uses code to create interactive features (for example, an interactive map on a pandemic news article)
- A web page that is useful despite only having a minimal amount of text content, for example an author bio page, image gallery page, or contact form page.
All of those are correct use cases that could cause a low text-to-HTML ratio.
a low text-to-HTML ratio can be a sign of:
- Hidden text, which is something spammers do, so it's a red flag for search engines
I have never heard of text hidden through conventional means (display:none
, visibility:hidden
, etc.) causing SEO issues. Search engines just skip it for the most part. If you're deliberately using black-hat techniques to cloak your text, such as positioning it off the page or coloring it white-on-white, then you don't need Text-to-HTML ratio to tell you that you're doing something wrong, you already know you are.
a low text-to-HTML ratio can be a sign of:
- A slow site – the more code and script pages contain, the slower they’ll load, and page load is an important SEO factor.
The relevant metrics here are JavaScript execution time and consequently page load time, which are only tangentially related to Text-to-HTML ratio. If you want to measure page load, just measure page load.
In conclusion, look at page weight and page load time. Text-to-HTML ratio for the most part does a bad job at approximating these much more useful metrics. In my opinion the only use of this metric might be to "flag" pages on your site as outliers, so that you can manually review them using better metrics and ask yourself if there's a good reason for them being an outlier.
Edit: As Stephen mentioned in the comments, Google's Core Web Vitals are a useful set of metrics that Google will start ranking on this year.