# Charset declaration is missing or occurs too late in the HTML

**URL:** <https://forums.realmacsoftware.com/t/charset-declaration-is-missing-or-occurs-too-late-in-the-html/56895>\
**Category:** Elements\
**Created:** [July 3, 2026, 9:02am UTC](https://forums.realmacsoftware.com/t/charset-declaration-is-missing-or-occurs-too-late-in-the-html/56895 "2026-07-03T09:02:44Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![jbob](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/jbob/32/31581_2.png) [@jbob](https://forums.realmacsoftware.com/u/jbob)\
**Post date:** [July 3, 2026, 9:02am UTC](https://forums.realmacsoftware.com/t/charset-declaration-is-missing-or-occurs-too-late-in-the-html/56895/1 "2026-07-03T09:02:44Z")

</div>

> **Charset declaration is missing or occurs too late in the HTML**
>
> A character encoding declaration is required. It can be done with a `<meta>` tag in the first 1024 bytes of the HTML or in the Content-Type HTTP response header. [Learn more about declaring the character encoding](https://developer.chrome.com/docs/lighthouse/best-practices/charset/?utm_source=lighthouse&utm_medium=lr).

The UTF Charset declaration appears on my pages around character 1800

If a character is a byte … then we need too be at the very top … so as to make Google happy

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/realmacsoftware1/original/3X/4/2/423513fe4ed693db22524a93ddffdb79de814310.png)

---

<div class="post-metadata">

**Author:** ![jbob](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/jbob/32/31581_2.png) [@jbob](https://forums.realmacsoftware.com/u/jbob)\
**Post date:** [July 3, 2026, 9:11am UTC](https://forums.realmacsoftware.com/t/charset-declaration-is-missing-or-occurs-too-late-in-the-html/56895/2 "2026-07-03T09:11:47Z")

</div>

Conversely, Google wants …

… html.scroll-smooth

to appear within one of the ‘landmark areas’ eg: head, body, footer … and it doesn’t

![image](https://europe1.discourse-cdn.com/flex005/uploads/realmacsoftware1/original/3X/f/e/fe94892d5f9d9ce2abbd8e049b571179c50265c3.png)

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/realmacsoftware1/original/3X/5/1/519656b4cc0315166221ea3dd27b9e507e4aa374.png)

---

<div class="post-metadata">

**Author:** ![Pegasus](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/pegasus/32/25035_2.png) [@Pegasus](https://forums.realmacsoftware.com/u/Pegasus)\
**Post date:** [July 3, 2026, 9:56am UTC](https://forums.realmacsoftware.com/t/charset-declaration-is-missing-or-occurs-too-late-in-the-html/56895/3 "2026-07-03T09:56:26Z")

</div>

You can fix this yourself in the **Project Settings → Template** section.

 ![Bildschirmfoto 2026-07-03 um 11.55.14](https://europe1.discourse-cdn.com/flex005/uploads/realmacsoftware1/original/3X/9/a/9a0e0497f0363940cde5b5a07119f403689f7f46.jpeg)

---

<div class="post-metadata">

**Author:** ![Fuellemann](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/fuellemann/32/22871_2.png) [@Fuellemann](https://forums.realmacsoftware.com/u/Fuellemann)\
**Post date:** [July 3, 2026, 10:07am UTC](https://forums.realmacsoftware.com/t/charset-declaration-is-missing-or-occurs-too-late-in-the-html/56895/4 "2026-07-03T10:07:33Z")

</div>

Or in the htacces with:

```auto
RewriteEngine On

# HTTP Content-Types
AddCharset UTF-8 .html

```

---

<div class="post-metadata">

**Author:** ![jbob](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/jbob/32/31581_2.png) [@jbob](https://forums.realmacsoftware.com/u/jbob)\
**Post date:** [July 3, 2026, 10:16am UTC](https://forums.realmacsoftware.com/t/charset-declaration-is-missing-or-occurs-too-late-in-the-html/56895/5 "2026-07-03T10:16:06Z")

</div>

Great - thanks guys .. I’ll try switching things around and see if Pagespeed is happier … and it all still works : )

---

<div class="post-metadata">

**Author:** ![pumpkin](https://avatars.discourse-cdn.com/v4/letter/p/ccd318/32.png) [@pumpkin](https://forums.realmacsoftware.com/u/pumpkin)\
**Post date:** [July 3, 2026, 9:41pm UTC](https://forums.realmacsoftware.com/t/charset-declaration-is-missing-or-occurs-too-late-in-the-html/56895/6 "2026-07-03T21:41:56Z")

</div>

Should that not be the default setting by elements?

---

<div class="post-metadata">

**Author:** ![jbob](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/jbob/32/31581_2.png) [@jbob](https://forums.realmacsoftware.com/u/jbob)\
**Post date:** [July 3, 2026, 9:52pm UTC](https://forums.realmacsoftware.com/t/charset-declaration-is-missing-or-occurs-too-late-in-the-html/56895/7 "2026-07-03T21:52:49Z")

</div>

I think so as the UTF Charset declaration must be within the ‘first 1024 bytes’ (see screenshot in first post) - otherwise it fails to be recorded as present. By default it seems to appear 1700 - 1800 bytes in

---

<div class="post-metadata">

**Author:** ![jbob](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/jbob/32/31581_2.png) [@jbob](https://forums.realmacsoftware.com/u/jbob)\
**Post date:** [July 3, 2026, 9:55pm UTC](https://forums.realmacsoftware.com/t/charset-declaration-is-missing-or-occurs-too-late-in-the-html/56895/8 "2026-07-03T21:55:39Z")

</div>

'Course I might be totally misunderstanding. Either way now, no error in Pagespeed : )
