FB Pixel

5 WordPress Errors That Can Derail Your Day (And How to Fix Them)

While WordPress is a generally solid platform, and should rarely throw any serious errors your way, issues can still arise. Some of these errors may take even the most experienced user by surprise. If you’re reading this post, you’re probably one of the unlucky few to experience one of them.

When an error occurs and you can’t easily spot its cause or guess at a solution, it’s only natural to worry. However, the good news is that even when it comes to the most uncommon WordPress errors, you can usually fix the issue yourself in a short amount of time.

In this post, we’ll discuss a few of the rarer issues you can face in WordPress. More importantly, we’ll show you how you can fix them. Let’s get to work!

1. You Have Exceeded Your Site’s Memory Limit

We’re going to start with an error that can seem deceptively complex, even though the solution is usually quite simple. This error concerns your site’s PHP memory limit.

Simply put, PHP is the language that WordPress is built on. By default, your server allocates a certain amount of memory to run the PHP code that makes your WordPress site functional. If your site exceeds this limit, you’ll see the following error (or something very similar):

Fatal error: Allowed memory size of xxxxxxxx bytes exhausted (tried to allocate xxxxxxx bytes) in /home4/example/public_html/wp-includes/plugin.php on line xxx

The solution to this problem is simple enough: raise the PHP memory limit. You can actually do this yourself, by editing one of your site’s files. To do that, you’ll need to access your site directly using a File Transfer Protocol (FTP) solution. We recommend using FileZilla, as it’s free and easy to set up.

Then, make sure you have the right FTP credentials from your web host, and use them to connect to your site. You should see a success message, and your FTP client should look something like this:

Accessing a WordPress site using FileZilla.

The file you need to edit is called wp-config.php, and you’ll find it in your site’s root directory. This is usually called public_html:

The wp-config.php file accessed via FileZilla.

Right-click on the wp-config.php file, and select the View/Edit option. This will open the file in your default text editor, where you can make changes:

Editing the wp-config.php file.

All you need to increase your memory limit is add a single line, which will set the new memory limit to 64MB:

define( ‘WP_MEMORY_LIMIT’, ’64M’ );

You’ll want to insert this towards the end of the code, just before the line reading /* That’s all, stop editing! Happy blogging. */:

Memory limit function added to wp-config.php.

You can now save the file. FileZilla will ask if you want to update the version of the file that’s on the server, and you’ll need to select Yes:

FileZilla message about updating a file.

Then, check your site to see if this fix has resolved the error. If not, you may need to increase the memory limit even further, which you can do by repeating the process and specifying another number as the second parameter (for example, “128M”).

If this still doesn’t work, you may have reached your site’s maximum allowed limit. In that case, you’ll need to contact your web host, as it may be able to raise your memory limit further.

2. You Encounter Errors When Uploading Media Files

There are actually several errors that can occur when you try to upload media to your WordPress site. Sometimes these occur because of issues with the file itself, such as its size being above the maximum limit, or the file type not being accepted by WordPress. In these cases, you’ll need to make changes to the file before uploading it, or contact your web host for more assistance.

However, there are some errors that you can resolve yourself. The most common media-related issue you’ll run into is known as the HTTP error. This appears when you try to upload an image, and can be particularly frustrating since it only returns a generic message:

HTTP Error message when attempting to upload an image.

The good news is that in most situations, this error is temporary and will go away on its own after a few minutes. However, if it persists even after some time has passed, you may need to diagnose it further.

A common cause of this issue is that your site has exceeded its memory limit. We explained how to deal with this in the previous section, so you’ll want to try that fix first.

If the error persists even after you’ve increased your PHP memory limit, however, the next step is to change your site’s image library. WordPress contains two different image editors, called Imagick and GD Library. This is usually something you don’t need to worry about, unless one of the libraries starts causing problems.

Typically, Imagick will be the cause of the HTTP error you’re seeing. Therefore, you’ll need to switch your site’s default setting to GD Library, which will once again require you to use FTP.

This time, you’ll be editing your site’s functions.php file. It will be located in your active theme’s folder, such as /public_html/wp-content/themes/themename:

The functions.php file in FileZilla.

All you have to do is paste the following code at the bottom of this file:

function hs_image_editor_default_to_gd( $editors ) {
$gd_editor = ‘WP_Image_Editor_GD’;
$editors = array_diff( $editors, array( $gd_editor ) );
array_unshift( $editors, $gd_editor );
return $editors;
}
add_filter( ‘wp_image_editors’, ‘hs_image_editor_default_to_gd’ );

This will set GD Library as the default image editor, which should resolve the HTTP error. If this still doesn’t fix the problem, however, it may be due to a compatibility issue with one of your plugins or your active theme. To test for that cause, try deactivating your plugins and theme, and see if that helps you diagnose the underlying issue.

3. Scheduled Posts Aren’t Being Published on Time

One of the more convenient WordPress features is the option to schedule posts to be published at a specific time. Occasionally, however, a post may fail to publish correctly. Instead, you’ll see the following message:

The Missed Scheduled Post error in WordPress.

This issue can be incredibly frustrating, but is fortunately very easy to resolve. There’s no code or FTP required. In fact, all you need is a plugin, namely Scheduled Post Trigger:

The Scheduled Post Trigger plugin.

To explain how this plugin works, you need to understand how WordPress deals with scheduled posts. In short, WordPress uses something called ‘cron jobs’ to automate key tasks on your site. The Missed Scheduled Post error occurs when the correct cron job doesn’t trigger at the right time.

Once installed and activated, Scheduled Post Trigger automatically checks to see if you have any scheduled posts that weren’t triggered, and remain unpublished. If it finds any, it instantly publishes them. It really is as simple as that!

4. Your Site Is Stuck in Maintenance Mode

Maintenance mode is a built-in feature that temporarily makes your site inaccessible to visitors during updates. This is helpful to avoid issues caused by users accessing your site in the middle of an update. Most of the time, maintenance mode is active for such short periods of time that you won’t even notice it happening.

However, it’s possible for your site to get stuck in this mode. This could happen if an update fails, or if you accidentally close the dashboard while one is taking place. Instead of your site, visitors will see a blank page containing a simple message, such as:

Briefly unavailable for scheduled maintenance. Check back in a minute.

Fortunately, the fix here is also easy. You’ll need to access your site using FTP, and then open up its root directory. There, you should find a file simple called .maintenance:

The .maintenance file in FileZilla.

All you need to do is delete this file. This should reset your site to normal, and you’re free to attempt the update again. If the update process still doesn’t complete properly, you may need to clear your site’s cache first.

5. You’re Seeing the 403 Forbidden Error

The 403 Forbidden error can appear in many places on your site, and under several different circumstances. However, it always means the same thing: “access denied”. In other words, this error tells you that you’re not allowed to access either your entire site, or a specific part (such as the wp-admin dashboard).

The most likely cause is that one of your security plugins is poorly configured, or is causing a compatibility issue. As such, you might want to test those plugins by temporarily disabling them, to see if that resolves the error. If not, it’s important that you reactivate your security plugins right away.

If a plugin is not to blame, the error is often due to a corrupt .htaccess file. We actually showed you how to deal with this problem in an earlier article, so refer to that guide for more information on fixing your .htaccess file. Once you have a new, uncorrupted version of the file in place, your site should be back to normal.

However, the 403 Forbidden error can also be caused by incorrect file permissions. These settings control who can access the various folders, files, and databases on your site. If your file permissions are configured poorly or if a plugin has altered them, you may need to return them to their proper defaults in order to gain access to your site again.

We generally don’t recommend that you change your file permissions manually, as this can have serious consequences across your entire site. Instead, you’ll want to reach out to your web host, which should be able to provide you with the correct permissions and guidance on how to implement them.

Conclusion

It’s never fun to come face-to-face with an error on your site, especially when it’s one you’re unfamiliar with. Fortunately, just because the error itself might be obscure doesn’t mean its solution has to be difficult.

To illustrate the point, we’ve shown you how to fix the following uncommon WordPress errors:

  1. You have exceeded your site’s memory limit.
  2. You encounter errors when uploading media files.
  3. Scheduled posts aren’t being published on time.
  4. Your site is stuck in maintenance mode.
  5. You’re seeing the 403 Forbidden error.

Are you experiencing any other WordPress errors that you need help fixing? Let us know in the comments section below!

Image credit: Pixabay.

Author

Will Morris

Will Morris

Will Morris is a staff writer at WordCandy. When he's not writing about WordPress, he likes to gig his stand-up comedy routine on the local circuit.

You’ll be joining a community of highly-vetted digital agencies and web professionals with one common goal — growth! Learn more. 

E-books

The Landing Page Builds service includes:

  • Unlimited page builds for one monthly rate
  • Dedicated account manager
  • Dedicated WordPress developer
  • At least 2 hours of daily dev time
  • Daily progress reports
  • Find out more here

The Content Edits Plan includes:

  • Unlimited content edits
  • White label help desk
  • Support ticket dashboard
  • 24/7 team of WordPress experts
Plus, everything in our Maintenance Plan:
  • Visual Validator WordPress updates
  • 90 days of off-site backups
  • Daily security scans and malware cleanup
  • Maintenance dashboard
  • Find out more here

The Maintenance Plan includes:

  • Visual Validator WordPress updates
  • 90 days of off-site backups
  • Daily security scans and malware cleanup
  • Maintenance dashboard
  • Find out more here