Are 404 images slowing down your WordPress?

Are 404 images slowing down your WordPress?

The answer is yes, if you have a significant amount of 404 images on your WordPress that are not found you could be seeing these effects. Whenever an image is request and it’s not found it needs to run through the WordPress stack to generate the nice looking 404 page.

This post is going to show you a quick and easy way to modify your Apache htaccess file to speed up your busy website.

Don’t run WordPress for missing images

We want WordPress to not run it’s fancy 404 page for images that are not found, so we’re going to add the following rewrite rules to your htaccess.

That’s all you need to do and now your using Apache rewrite rules to check if the image exists, if it doesn’t exist it issues a 404 response and says this is the last response, and don’t continue any more rules. So we’re then bypassing the rules to run WordPress.

I just implemented this on a customers website that had lots of missing images, they were running a load of 6+ and now it’s dropped down to 1.85.