• Resolved driver49

    (@driver49)


    My Semrush Site Audit informs me that I have ~200 pages on my site with a TEXT:HTML ratio of less than 10%.

    A lot of these pages have migrated over the years from an old TypePad blog to what is now the second or third iteration of the WordPress installation. I suspect a lot of that unwanted code comes from those earlier iterations (since I don’t have a similar problem with newer posts).

    I am already running Autoptomize, but that’s not doing what I need here.

    Is there a plugin that can look at the code in my old posts and delete the detritus?

    Yeah, I know I’m looking for an easy fix but my experience with WP to date suggests there usually is one if I ask.

    Thanks,

    –PS

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • The HTML code in the frontend is generated by the theme you choose. You would have the possibility to “slim down” individual components of its templates via child theme. Or you can use another theme, which can handle less HTML code.

    Optimization plugins like Autoptomize reduce at most the spelling of HTML codes, but not the structure that the theme generates since CSS properties depend on it. I don’t think you will find a plugin that manipulates the code in the way you want, because the styling might be broken.

    Thread Starter driver49

    (@driver49)

    Thanks for the reply.

    I kinda know that the code is coming from the theme. I’m using the Astra theme, and the posts I create with it are clean and none show up in the HTML:TEXT ratio warnings.

    The problem near as I can tell is that all the posts that do show up in those warnings are really old and created with Typepad, and I think that is the source of the undesirable ratio, either directly from Typepad or as a consequence of the conversation to WordPress. Durned I know.

    It occurs to me that I could take the content from the original posts – without any of the underlying code – and recreate the posts inside of just Astra, but that would be a lot of work on a lot of posts of limited current value when all I’m trying to do is improve the ‘Site Health’ number.

    Which, unfortunately, is precisely the kind of ‘busy’ work I tend to do instead of ‘real’ work…. ?????♂?

    Thanks,

    –PS

    The article you linked is 95% source code from Astra. The remaining 5% is the text itself and that already contains minimalist HTML code, albeit with unnecessary Microsoft CSS classes. But they don’t necessarily bloat the code, since the bulk is generated by Astra, as I said.

    You could try opening the old text in the Block Editor and saving it. Maybe this will remove the unnecessary CSS classes. But you won’t really reduce the source code.

    The problem near as I can tell is that all the posts that do show up in those warnings are really old and created with Typepad, and I think that is the source of the undesirable ratio, either directly from Typepad or as a consequence of the conversation to WordPress. Durned I know.

    The legacy Typepad stuff only appear after the <body> tag. But that’s already two-thirds of the way down the HTML view of your homepage. From the top up to this two-thirds point where the <body> tag begins is mostly full of CSS and JS code from the Astra theme.

    Also, and I feel like I’m beginning to sound like a broken record here, you should always take these tools and their recommendations for what they are: mere tools. You need to add your human judgement to these recommendations and decide whether to bother “fixing” what they report or not.

    Many of these same tools recommend inlining CSS and JS. The idea is to avoid the extra HTTP trips to load the external files, thereby speeding up the site (that’s the theory). It seems that’s what Astra is doing here.

    But if you’re going to inline all your CSS and JS (some would even convert small decorative images to ginormous blobs of inline data URIs), then you’re necessarily going to have a very high HTML-to-content ratio!

    Thread Starter driver49

    (@driver49)

    ‘Also, and I feel like I’m beginning to sound like a broken record here, you should always take these tools and their recommendations for what they are: mere tools. You need to add your human judgement to these recommendations and decide whether to bother “fixing” what they report or not.

    That’s some sage counsel there. I appreciate your taking the time to dive into the code and disabuse me of my misconception re: the source of the wonky ratio. I think I’ll just mark this one ‘resolved’ and move on to the next dilemma…. ??

    Thanks,

    –PS

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Plugin to Fix HTML:TEXT Ratio’ is closed to new replies.