The WordPress Codex: An Invaluable Resource for Better Coding
Tags: wordpress, php, sql
Published: 2019-07-25 20:32:42

In 2003, WordPress <a href="https://pagely.com/blog/wordpress-internet-dominance/">entered into existence</a> and irrevocably changed the way we conduct business in the 21st century. Business owners no longer needed a brick-and-mortar presence in order to viably compete in their market. Heck, they no longer even had to deal in tangible goods and services if they didn't want to. WordPress simplified the process by which <em>anyone</em> could start and successfully run a website.

WordPress users occasionally run into things that trip them up along the path to development--this applies not only to novice users but to experienced WordPress developers as well. While WordPress does not provide a dedicated support team to field questions or concerns, their support forum is manned by WordPress volunteers.

We can find a ton of great help in the <a href="https://codex.wordpress.org/" target="_blank" rel="noopener">WordPress Codex</a>; basically, WordPress's version of a user manual.

Anyone whose workflows are heavily entrenched within WordPress should have a firm handle on the WordPress Codex. So, let's take a closer look how you can make the most out of what information is available there.
<h2>12 Key WordPress Codex Pages You Should Know About</h2>
Here is what the main page of the Codex looks like:

<img class="aligncenter size-full wp-image-12783" src="https://pagely.com/wp-content/uploads/2018/01/WordPress-Codex-Main-Page.png" alt="WordPress Codex Main Page" width="900" height="500" />

It looks basic enough at first glance, but there's a lot of invaluable information here for WordPress users--especially web developers looking to tap into the CMS's advanced features and learn how to code better. The key is to look past the design and navigation, and ignore the fact that some pages are "incomplete". Then, go straight for the good stuff.

But how do you find this "good stuff"?

If you're working in an enterprise or for a large agency, you likely won't need <a href="https://codex.wordpress.org/New_To_WordPress_-_Where_to_Start" target="_blank" rel="noopener">the WordPress basics</a> they tend to put front and center in the Codex: what is a blog? how do you upload files? what is a color palette? It's nice to know that that stuff is there, but you can disregard that for now. (It would serve as great training material for when you bring a WordPress novice onto your team though.)

Instead, acquaint yourself with, and bookmark, the following WordPress Codex pages. These will give you a deeper understanding of how to work in the backend of WordPress and improve your coding skills regardless of whether you build websites, themes, or plugins for a living.
<h3>1. Requirements</h3>
The <a href="https://wordpress.org/about/requirements/" target="_blank" rel="noopener">Requirements</a> page is a very basic one. In short, it lets you know what the ideal technology is for your WordPress site's hosting environment, including:
<ul>
 	<li>PHP</li>
 	<li>MySQL or MariaDB</li>
 	<li>HTTPS</li>
 	<li>Apache or <a href="https://pagely.com/case-studies/nginx/">NGINX</a></li>
</ul>
For agency folks, while you and your WordPress development team are well-aware of your requirements, your clients may not be. They might even insist that their outdated or insecure web hosting will suffice. By providing them with this page of requirements--and even the ready-made prompt they can provide to their web hosting provider--you can ensure that you're always developing websites with the latest server technology.

Or you can simply advise clients to use <a href="https://pagely.com" target="_blank" rel="noopener">Pagely managed WordPress hosting</a>. Then you'll never have to worry about this page or fulfilling those requirements again.
<h3>2. WordPress Coding Standards</h3>
It doesn't matter what type of WordPress applications you build, coding standards should always be adhered to. This is beneficial for a couple reasons. Of course, there is the end user who is sure to have a better experience on your site thanks to clean coding practices. There is also your organization that will benefit from this as your team learns about and consistently applies quality coding to each and every project you produce.

The <a href="https://codex.wordpress.org/WordPress_Coding_Standards" target="_blank" rel="noopener">WordPress Coding Standards</a> page will link you out to four resources, each of which provides guidance on how to properly code with:
<ul>
 	<li>PHP</li>
 	<li>HTML</li>
 	<li>CSS</li>
 	<li>JavaScript</li>
</ul>
<img class="size-full wp-image-14948 aligncenter" src="https://pagely.com/wp-content/uploads/2018/06/Screen-Shot-2018-06-13-at-4.55.33-PM.png" alt="" width="975" height="653" />

These are incredibly thorough guides from the Make WordPress Core handbook and cover the standards you should use whether you develop websites, plugins, or themes for WordPress.
<h3>3. HTML to XHTML</h3>
While the HTML coding standards guide mentioned above will likely become your end-all, be-all for coding with HTML, you may find this <a href="https://codex.wordpress.org/HTML_to_XHTML" target="_blank" rel="noopener">XHTML</a> reference helpful too. Basically, it explains why web developers should be coding with XHTML in WordPress instead of HTML and then provides some guidelines on how to do so.
<h3>4. Finding Your CSS Styles</h3>
For those of you who use WordPress themes in your web design work, you may have encountered this issue. As a whole, you like the WordPress theme you're working with; however, there are some elements you want to alter or do away with completely, but you can't do so without editing the CSS. This means altering your CSS styles and knowing which code within your stylesheets will make the changes.

The <a href="https://codex.wordpress.org/Finding_Your_CSS_Styles" target="_blank" rel="noopener">Finding Your CSS Styles</a> page will teach you how to read the stylesheet and find the right element every time. If you need a little more advanced help, you can check out this article <a href="https://pagely.com/blog/advanced-css-5-methods/" rel="noopener">Advanced CSS</a>.
<h3>5. CSS Troubleshooting</h3>
The <a href="https://codex.wordpress.org/CSS_Troubleshooting" target="_blank" rel="noopener">CSS Troubleshooting</a> page is another reference you should have on hand if you code with CSS. Within this page, you'll get a general rundown of the elements that comprise CSS as well as the various ways in which you can check for errors and bugs caused by them.

There's a link tucked into the bottom of this page that handles <a href="https://codex.wordpress.org/CSS_Fixing_Browser_Bugs" target="_blank" rel="noopener">how to fix browser bugs</a> that you'll want to check out as well. It discusses how different browsers and even on-site translations could lead to bugs in the delivery of your site to users, so it's a good one to familiarize yourself with even if it's not a common problem you encounter.

<img class="size-full wp-image-14949 aligncenter" src="https://pagely.com/wp-content/uploads/2018/06/Screen-Shot-2018-06-13-at-5.01.42-PM.png" alt="" width="802" height="453" />
<h3>6. Stepping into Templates</h3>
In addition to being able to code well in WordPress, you should have a good understanding of what templates are and how to use them when building a website or theme from-scratch. <a href="https://codex.wordpress.org/Stepping_Into_Templates" target="_blank" rel="noopener">Stepping into Templates</a> explains what these building blocks are as well as some best practices on how to use them.
<h3>7. Validating a Website</h3>
There is a lot to remember in the web development process. And not only do you need to remember how to follow a consistent process and deliver outstanding results, but you need to ensure that you abide by the general standards that rule the web. Unfortunately, there are <em>a lot</em> of them. Fortunately, the <a href="https://codex.wordpress.org/Validating_a_Website" target="_blank" rel="noopener">Validating a Website</a> page provides a checklist to make sure you tick off each one before completing and delivering your next WordPress website.
<h3>8. Migrating Multiple Blogs into Multisite</h3>
The <a href="https://codex.wordpress.org/Migrating_Multiple_Blogs_into_WordPress_3.0_Multisite" target="_blank" rel="noopener">Migrating Multiple Blogs into Wordpress 3.0 Multisite</a> is a short guide that provides the steps you need to take when creating a Multisite network from disparate WordPress sites. Agencies, conglomerate news sites, and other large networks will find this page useful in checking off all the boxes for a successful migration. We have another very useful article on navigating Multisite <a href="https://pagely.com/blog/wordpress-multisite/">here</a>.
<h3>9. WordPress Optimization</h3>
Regardless of the size of WordPress site you're building, performance optimization is an important part of your process. The <a href="https://codex.wordpress.org/WordPress_Optimization" target="_blank" rel="noopener">WordPress Optimization</a> page as well as the <a href="https://codex.wordpress.org/High_Traffic_Tips_For_WordPress" target="_blank" rel="noopener">High Traffic Tips for WordPress</a> offer comprehensive coverage of everything you should do to ensure each page opens quickly and without issue.
<h3>10. Hardening WordPress</h3>
Another type of optimization you should have a laser focus on when developing WordPress sites is security. While security is something a <a href="https://pagely.com/solutions/secure-wordpress-hosting/" rel="noopener">managed WordPress host</a> can help you with, there are always steps you should take in your own process to add extra layers of security to your site.

The Codex's <a href="https://codex.wordpress.org/Hardening_WordPress" target="_blank" rel="noopener">Hardening WordPress</a> covers all angles here, so keep this list on hand to serve as a reference while you develop WordPress sites. Also, be sure to read up on <a href="https://codex.wordpress.org/Data_Validation" target="_blank" rel="noopener">Data Validation</a>. This explains the process by which incoming and outgoing data is validated and why you should pay close attention to it since it affects what your visitors experience in their browser.
<h3>11. Theme Development</h3>
For anyone in the business of designing WordPress themes, the <a href="https://codex.wordpress.org/Theme_Development" target="_blank" rel="noopener">Theme Development</a> page is for you. While this guide won't necessarily give you step-by-step instructions on how to build a theme from the ground up, it will cover the technical specifications you should familiarize yourself with before you begin any type of WordPress theme development.

You'll learn about the anatomy of a theme (i.e. the essential files you have to create), what templates are and how to use them, and there are tips on how to test your theme before submitting it to the WordPress repository or selling it through a marketplace.

<img class="size-full wp-image-14950 aligncenter" src="https://pagely.com/wp-content/uploads/2018/06/Screen-Shot-2018-06-13-at-5.05.09-PM.png" alt="" width="802" height="544" />
<h3>12. Writing a Plugin</h3>
For agencies in the business of creating WordPress plugins, the <a href="https://codex.wordpress.org/Writing_a_Plugin" target="_blank" rel="noopener">Writing a Plugin</a> page is for you. This guide is similar to its theme counterpart except that it focuses more on programming tips and guidelines.

It also provides mini-guides on how to internationalize your plugin as well as update it, both of which are helpful and essential add-ons if you intend on offering your plugin through the WordPress repository.
<h2>WordPress Codex: An Invaluable Resource for Better Coding</h2>
As you can see, there is some really valuable information to be found in the WordPress Codex. It simply takes some time to dig through the navigation to get a sense of where the good parts of it sit.

Hopefully, the list of key WordPress Codex pages above will point you in the right direction and get you up-to-date with WordPress's guidelines and recommendations for cleaner, stronger coding practices.