Title: WordPress coding standards
Last modified: August 20, 2016

---

# WordPress coding standards

 *  Resolved [Neil](https://wordpress.org/support/users/ademmeda/)
 * (@ademmeda)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/wordpress-coding-standards/)
 * Hi,
 * I started learning WordPress plugin development and I would like to learn as 
   many things as possible the right way at the beginning.
 * I have been going over the coding standards page:
    [http://codex.wordpress.org/WordPress_Coding_Standards](http://codex.wordpress.org/WordPress_Coding_Standards)
 * In the “Space Usage” section, it suggests to add spaces before and after parenthesis
   of blocks and functions. I accept that this improves the readability but when
   I checked the WordPress installation files (e.g., wp-login.php) I noticed that
   they are not standardized either. In some places there are spaces as suggested,
   but in some places there aren’t.
 * I am used to coding with no spaces (if not necessary) and I want to ask your 
   opinion about this coding standards. Is it better that I stick to them? If they
   are standards, why the WordPress files are not following them strictly?
 * Thanks,
 * Nail

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Moderator [Jan Dembowski](https://wordpress.org/support/users/jdembowski/)
 * (@jdembowski)
 * Forum Moderator and Brute Squad
 * [14 years, 3 months ago](https://wordpress.org/support/topic/wordpress-coding-standards/#post-2580585)
 * > If they are standards, why the WordPress files are not following them strictly?
 * The standards are really a guideline to make PHP code more readable and by extension
   understandable. Adherence is subjective and that makes it dubious to decide what’s
   good or not.
 * Although while bad code is easy to spot, it’s not so easy to clearly state where
   the line is. 😉
 * > I am used to coding with no spaces (if not necessary) and I want to ask your
   > opinion about this coding standards. Is it better that I stick to them?
 * It’s your code but it really comes up when you submit your plugin, theme, or 
   patch for others to review. No spaces doesn’t necessarily mean not readable but
   it could.
 * If you want your code to be accepted into the plugin repo, ask yourself “if a
   complete stranger who understands PHP read my code, would he get it or walk away
   with a headache?”
 * That’s part of what that standard is attempting to address and help you create
   clean concise readable code. It’s also why I think it’s better to stick with 
   them.
 *  Moderator [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * (@ipstenu)
 * 🏳️‍🌈 Advisor and Activist
 * [14 years, 3 months ago](https://wordpress.org/support/topic/wordpress-coding-standards/#post-2580612)
 * Actually the only reason un-readable code MIGHT get yanked from the repo is if
   it looks like the author’s intentionally obfuscating naughty things.
 * But there isn’t much to prevent someone from getting hosted, just the cardinal‘
   don’t be a d**k’ 😉
 *  Thread Starter [Neil](https://wordpress.org/support/users/ademmeda/)
 * (@ademmeda)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/wordpress-coding-standards/#post-2580745)
 * Thanks for your ideas.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘WordPress coding standards’ is closed to new replies.

## Tags

 * [Coding](https://wordpress.org/support/topic-tag/coding/)
 * [standards](https://wordpress.org/support/topic-tag/standards/)

 * In: [Everything else WordPress](https://wordpress.org/support/forum/miscellaneous/)
 * 3 replies
 * 3 participants
 * Last reply from: [Neil](https://wordpress.org/support/users/ademmeda/)
 * Last activity: [14 years, 3 months ago](https://wordpress.org/support/topic/wordpress-coding-standards/#post-2580745)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
