v.7

Make sure your connection is secure ("httpS:" instead of just "http:"). Click the logo above for a secure connection.

| Menu ☰ |
× close
Home Products Services Blog Contact

CMSbyCW Demo CMSbyCW Tutorials / FAQs / Documentation CW Cyberspace Invaders (people liked it!) What's cooking?

How to fix that blank bar that all of a sudden appears on top of your website header (remove BOM )

How to fix that blank bar that all of a sudden appears on top of your website header (remove BOM )

Published on: 02/01/2026, 11:52 PM by Software Developer

As I was deploying another instance of the CMSbyCW on a fourth website, I noticed a blank bar that all of a sudden appears on top of the website header, when clicking the Blog. 

I just finished the Landing Page for AGDTechnology. 

It was a ONE page that I also worked on for one WEEK. 

It was designed to be a noisy webpage. 

Anyway, then the site went offline for a bit, then it went back up,and then I noticed these weird codes" upon inspecting the elements in the console. 

 

I know, right?  

I didn't program that in there.  I guess it gets inserted in transit via FTP? 

What is BOM? = Byte Order Mark

BOM is an invisible Unicode character that some editors (especially on Windows) add at the very start of UTF-8 files.

Hex FEFF = BOM

Browsers see it as text, which explains the #text node and the thin “blank bar” at the top.

It also triggers the Quirks Mode warning, because the browser sees content before <!DOCTYPE html>.

Weirdness

 Anyway, Here's how I fixed it:  

Use this code, put it at the very top of the php file, like so, : 

<?php
// Remove BOM if present at the very start of output
ob_start(function($buffer) {
    return preg_replace('/^\x{FEFF}/u', '', $buffer);
});

One thing great with this "light version CMS" is it's easy to upload and easy to see the changes right away.  

So I fixed the 3 installations and going on the fourth website.  

Of course I will make sure all these codes are inside the ZIP file for the future clients.  :-) 

Just thought I'd add this here for others to use, in case they need it,  

Got feedback?

Click HERE and Leave a comment

Share:




Thank you for visiting our website!