• I posted about this in an old thread but I want to make sure I get help, and log this problem in the slugs. I know other people have the same issue.

    Well, here’s the error:

    ———-
    Line 2 column 0: character “?” not allowed in prolog.

    ???<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “https://www.w3
    ———-

    I am assuming that it is coming from my header.php file, as that is where the doctype is specified. I have opened the file in both hex editors and text editors that allow me to see BOM (Byte Order Marks) but they are not there. I also think it is weird that it is calling it line two when my DocType is on line one. I have checked for line breaks and as far as i can tell, I cannot see any BOM marks.

    I am using WP 2.1, the theme is based on “forestgreen” from the WP Theme Database and I am using a Mac computer with BBEdit as my primary editor.

    Any ideas or help would be appreciated.

    My site: https://www.timbercrawler.com/wp_nicole/?cat=3

    If you click home and validate it there’s no error, only on the other pages. Hmmm…?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Could you open the header.php in the wordpress theme-editor? Try to delete any “blank” spaces before the <!DOCTYPE
    Have you checked if you have any plugin that could have inserted those characters?

    Thread Starter subtype

    (@subtype)

    Yes, I have opened the file in these editors:

    WordPress Theme Editor
    WordPress WYSIWYG editor (then turned it back off)
    Microsoft Wordpad (I had to touch Windows, icky! icky!)
    BBEdit on Mac
    EditPlus (Windows icky! icky!)
    EncodingMaster
    Two hex editors and an ASCII editor

    I even SSH hashed into the file on my mac using Vi and every single one of these has the <!DOCTYPE starting at line one, column one… there’s nothing there! I know about hidden BOM (Byte Order Marks) but i cannot see them, kind of like quantum physics, we know it’s there but we cannot see it; just its effects.

    Can someone tell me for certain if that is indeed what I am dealing with, is BOM marks, or is something else wrong with my code? I doubt it is that, I have copies/pasted that first line from like 6 other themes including default and I get the same error. I even created a new file using Unicode UTF-8, No BOM set in my editor, and I STILL get the damn marks. I know it is something simple, but what is it?

    How would i check if a plugin inserted them?

    I use:

    wp-tables
    EXEC-PHP

    that’s it.

    You could de-activate the plugins one by one and check if something changes.
    Looking at all the effort you have put in to edit header.php, one could say that the BOM is not in that file.
    wp-table is inserting css code in the header, there is also something from WP-PageNavi 2.11. Have you checked the plugin files for BOMs?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘W3 Validator Error I can’t Fix’ is closed to new replies.