Dealing with White Screens of DOOM in WordPress

WordPress Logo

We’ve all been there. Happily writing our PHP for some template or another. But then you save your file and refresh the page and…the screen stays completely white.

So why does this happen? Most likely you’ve made a syntax error somewhere. Like, say, forgetting a semi-colon or curly bracket. Another reason is that you’ve reached the memory limit of your server. The latter will usually happen when you enable a particularly poor plugin or theme.

The reason this comes up as a white screen of DOOM is because your errors are being suppressed.

While this isn’t necessarily a bad thing on a production server (though, you do test your code before pushing it live, right? Right?), it can be very inconvenient while you’re developing a new template or WordPress plugin.

To get rid of this inconvenience on a development server is fairly simple. All you need to do is open up your wp-config.php file and locate the line that says: define('WP_DEBUG', false);. Change false to true and you should be good to go. If it’s not there, you can add it anywhere above where it says /* That's all, stop editing! Happy blogging. */.

Should this not work (it’s somewhat unlikely, but it’s possible), you can also set PHP’s error reporting on the fly.

And there’s that. My first quick tip. I’ll most likely post more of these in the future. If you’re still having issues with errors plaguing your WordPress website, drop me a line and we’ll figure it out together.

Test for potential accessibility issues

Are you interested in improving your website’s accessibility, but not sure where to start? There’s tools out there that will help you get started!

The tool that we use for this very purpose is “WAVE”. You can use their online verification tool or download their toolbar for Chrome or Firefox.

This tool will not only check for errors like missing alt texts, missing labels for input fields, and empty headers or links. It will also show you structural elements and HTML5/ARIA features you’re using to promote screenreader compatibility.

Lastly, it will also show you whether there are issues with the colour contrast on parts of your page.

There is one thing to note: When using the toolbar, you will want to be on the lookout for errors and warnings caused by other extensions you have installed. Some extensions will inject HTML into the page you’re on, which then gets sent to the WAVE toolbar as part of your page. Unfortunately the toolbar doesn’t have that nifty codeview that will help you locate what part of your code needs fixing, so you will need to double check the web version to double check the results.

Using these tools should allow you to get a good idea of what you’re up against. If you got no errors, then good job! Overwhelmed by the errors and notices? Contact me and get some help!

All WordPress pages but the homepage give a 404 error

More and more often I keep seeing posts asking about what’s going on with their site when only the homepage seems to be working. Even developers are sometimes caught off-guard when this happens. This little quick tip should help you out in roughly 99.99999999% of the time.

So how would you fix this? Simple. Just re-save the permalinks. That’s literally all there is to it.

A screenshot of a portion of the admin menu, highlighting Settings and Permalinks.

To do so, what you’ll need to do is head over to the “Permalinks” settings page. You can find this page by hovering over the “Settings” option in the left sidebar of the admin and then selecting “Permalinks”.

Once the page loads, you don’t even have to touch any settings. Simply click the blue “Save Changes” button that is near the bottom of the page.

Now, it may be cause for alarm when your site has been running great for a while and suddenly your subpages don’t work. In those situations, re-saving the permalinks will also work but you will also want to look for the root cause of why they broke. Otherwise, you may end up re-saving them every other week. In general, you’ll want to consider what plugins you installed last, and what plugins have been updated recently.

If re-saving your permalinks doesn’t fix this issue (I can almost guarantee that it will, but you never know), find me on Twitter and I’ll help you figure it out.