WordPress head meta tags, scripts, links showing up inside body tag (Header appearing in body tag)

Sometimes in WordPress the header tags and links start appearing inside the body tag.


 
 
 
   "
    "
  meta tags and stylesheets
  the content
 

This problem generally occurs due to specific encoding of the file. We need to change the file encoding from UTF-8 to “UTF-8 without BOM” (BOM=”byte-order-mark”) and save it again. We can use Notepad++ as it allows us to specify the encoding we want to save the file in.

To change the default encoding for new and/or opened documents in Notepad++ go to Settings -> Preferences -> New Document/Default Directory and under encoding select “UTF-8 without BOM” and select “Apply to opened ANSI files” as well.

notepad-plus-plus-default-encoding

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.