One of the most common problems experienced in shared hosting environments is excessive resource usage. If a large enough number of people visit your website, you could consume an inordinate amount of resources and affect the performance of other websites that share the same server. In this situation, your web host has little choice but to temporarily disable your account to inconvenience the least possible number of customers.
WordPress can be extremely heavy on a server’s resources; especially if it’s poorly optimized, uses a bloated theme or has far too many plugins running. These are some simple steps you can take to reduce the server load of WordPress websites, though the principles can be applied to virtually any content management system.
Each page view on a WordPress website is dynamically generated. PHP is used to turn all of your theme’s template files into a single HTML page and the actual content of the page gets pulled from the database using MySQL queries.
When you install a caching plugin on your website, each page only needs to be generated from scratch once. After the first visit, each page is saved to the server’s hard drive where it can be served to all subsequent visitors without PHP or MySQL getting involved. By reducing the amount of work the server needs to do on each pageview, caching plugins reduce server load and considerably accelerate the loading speed of your website.
CloudFlare (or other CDN)
A content delivery network (CDN) is a service that speeds up your website by serving your content from geographically distributed datacenters instead of your origin server. Sound confusing? WPBeginner have a comprehensive guide that explains what CDNs are and the benefits of using them.
CloudFlare is a special kind of CDN that acts as an intermediary between your website and your visitors. This allows it to provide performance and security improvements to your entire site with virtually no configuration required. Best of all, CloudFlare is completely free for a basic account.
Each plugin adds something extra to your website. The more you add, the heavier and slower your website will become. Look for plugins that you don’t really need or plugins that could be swapped for a less resource-intensive alternative.
GoDaddy’s P3 Performance Profiler plugin is very useful for determining exactly how much time each plugin takes to load, allowing you to make an informed decision on which should be removed.
Use a better WordPress theme
Not all WordPress themes are created equally. Many of the most popular themes today have huge feature lists, boasting dozens of page templates, 500+ fonts, ten slider plugins, animated everything and robust page builder features. While these themes make it incredibly easy to create a beautiful website, having so much “stuff” will make your website slow and bloated.
A lightweight, nimble theme is almost always going to be faster than a thousand-feature monstrosity. If switching themes isn’t an option, you may be able to find a WordPress freelancer who can strip all the bloat out of your theme.
You can reduce some of the weight of your WordPress site by decreasing the size of your image files. You can do this by using compressed JPEG images instead of the larger PNG or BMP extensions. You should also resize the picture in an image editor so it’s the exact size you need. Larger-than-necessary images are just wasteful.
Finally, you can make image files lighter by using a compression plugin or service. Try to use third-party services instead of something installed on your server, as doing compression locally will just increase server load. There’s great free tools such as Compress JPEG and TinyPNG that will run in your web browser.
The web is crawling with bots. Most are completely harmless and are just trying add your site to Google’s index or gather stats, however there are many bots designed with a more nefarious purpose. Many bots will attempt to guess your login credentials, send spam or look for exploitable security holes in your code. Taking steps to block these not only protects your site from getting hacked, but reduces the amount of server resources being used handling “fake” visitors.
There are a number of ways to keeps bots at bay. The aforementioned CloudFlare will stop many of them from ever accessing your site, while plugins such as Limit Login Attempts will block bots after they have attempted to login to your website more than a couple of times. There are also great plugins like WangGuard that attempt to stop bots from being able to create accounts and post spam on your site.