Recommended File Standards for Web Development

These settings help keep files consistent and compatible, reducing problems across different editors, operating systems and web servers.

For Web Development

  • End Of Line (EOL): LF (\n) > Applies only to text files (1)
  • Encoding: UTF-8 without BOM > Applies only to text files (1)
  • Final newline: End every text file with one newline character > Applies only to text files (1)
  • Trailing whitespace: Remove spaces and tabs from the ends of lines > Applies only to text files (1)
  • Filename case: Linux is case-sensitive, consistently prefer lowercase filenames

For WordPress specifically

  • PHP-only files: Omit the closing ?>
  • File permissions: Normally 644 for files and 755 for folders

More info

Types of files

  1. Text files.php, .css, .scss, .js, .html, .json, .xml, .svg, .txt, .md, .po, .pot…
  2. Binary files.jpg, .jpeg, .png, .gif, .webp, .ico, .woff, .woff2, .mo, .pdf, .zip…

End Of Line (EOL)

  • CRLF = carriage return + line feed = \r\n = 0D 0A > Used traditionally by Windows
  • LF = line feed only = \n = 0A > Used by Linux and modern macOS > Recommended for Web Development

UTF-8 / BOM

  • UTF-8 = Standard encoding text characters into bytes > Used across Windows, Linux, macOS and the web
  • BOM = Byte Order Mark = EF BB BF > Optional invisible bytes placed at the beginning of a UTF-8 file
  • UTF-8 without BOM = UTF-8 text without EF BB BF at the beginning > Recommended for Web Development

Contact me about: Recommended File Standards for Web Development, by:

  Email »  WhatsApp »