Can WordPress scale? For a mission-critical website, that might quite literally be the million dollar question.
Now powering more than a third of the web, WordPress is the versatile CMS used for building a wide range of sites.
But can the world’s most popular content management system handle the pressure when things heat up? When the analytics start getting into the millions of views? When your WordPress site’s database is getting pummeled by queries?
Here’s the short of it:
Yes, WordPress can scale.
It’s used by big enterprises serving millions of visits and, with the right techniques in place, it can be the engine that powers your site to success.
In this post, we’ll start with a little show and tell to prove our point. Then, we’ll dig into some of the biggest technical considerations you need to pay attention to when scaling WordPress.
How to Scale WordPress: Six Technical Considerations
Ok, so big enterprises are successfully scaling WordPress for millions of visitors. Now for the important question – how do you make WordPress scale?
If you want to set your WordPress site up for success under scale, here are some of the most important technical considerations…
1. Code Best Practices
Not all WordPress sites are created equal. The quality of your code, how your WordPress theme is structured and the way in which your database is queried are key. Just a handful of inefficient queries could dramatically slow down your site when you start to serve millions of page visits per month.
In summary, your WordPress site needs to be built by developers who really know what they are doing – they need to know their way around WordPress best practice coding standards and have delivered projects at some degree of scale in the past (and have probably learned some lessons the hard way – I know we certainly have).
WordPress Speed OptimisationDownload
2. Infrastrastructure & Horizontal Scalability
Investing in solid hosting infrastructure and clever technology is a key part of helping WordPress to scale.
Vertical scalability helps scale WordPress to a point, but after that, you’ll need to scale horizontally to create a WordPress site that can reliably handle high traffic and avoid downtime.
That is, rather than using a single server to power your site (vertical scaling), you need to run your site from many servers at once (horizontal scaling).
To horizontally scale WordPress, you’ll need to pay special attention to the wp-content/uploads folder, as well as how updates are deployed, load balancing, caching, and content delivery networks.
Our preferred hosting partner is WP Engine – they have a lot of clever technology built into their platform and tailored solutions for enterprise WordPress websites.
We have a mature DevOps setup here at 93digital with a continuous integration pipeline managed with GitLab that incorporates clever automation to check security, accessibility, coding standards and more, with a branching strategy that ensures safe and effective code deployment.
3. Reverse-Proxy Page Caching and Persistent Object Caching
When it comes to scaling WordPress, there are two types of caching you’ll want to focus on.
First, there’s page caching. While page caching plugins are popular for low-traffic WordPress sites, you’ll want to skip the application-driven plugin if you want to scale.
Reverse proxy caching (like Varnish) is a better option because it won’t require loading the application on every request (like a WordPress caching plugin does). Some specialist hosts like WP Engine have elements of caching built into their platform.
Beyond reverse proxy page caching, persistent object caching lets you lessen the load on your database and improve database efficiency by persistently storing the object cache between requests (unlike the default WordPress behaviour, which is to discard objects at the end of a request).
4. Database Optimisation
The two caching methods above are one way to increase database efficiency, but you’ll likely need to further optimize your database to scale WordPress.
The HyperDB plugin (written by the core team) adds support for read replicas, which lets you send read requests (SELECT) to replicas, while using your master database for UPDATE or INSERT requests.
You’ll also need to proactively monitor for slow database queries. New Relic is our favourite application monitoring tool when it comes to detailed performance measurement of a WordPress install.
5. Search Indexing
WordPress’ built-in content search wasn’t originally built to scale under high traffic and for large amounts of content.
Instead of relying on your database for search queries, a search index (like ElasticSearch or ApacheSolr) lets you offer better search functionality while also getting those search queries away from your primary WordPress database. A more distributed architecture can also come with additional performance and longevity benefits.
Whilst security is not in itself a key part of literally achieving scale with WordPress, it’s definitely high on the agenda for most of our enterprise clients and a key consideration.
There is, of course, a human and process side to security, whilst coding best practices are key. But there are other things we can do to lock down WordPress from a technical perspective. From ensuring the use of relevant security headers, locking down the WordPress REST API endpoints, implementing IP address whitelisting for login, implementing two-factor authentication and more – we’re always thinking about how we can deliver WordPress securely and scale.
Three Real-Life Examples of WordPress Working Under Scale
Seeing is believing – so rather than jumping straight into the technical part of how to scale WordPress, let’s take a look at some real-world examples of WordPress working under scale.
For all of these examples, we’re pulling the traffic estimates from SimilarWeb.
During regular months, Nate Silver’s Disney-owned FiveThirtyEight serves around 3 million visitors per month. During election season in the USA? Well, let’s just say there’s a lot of refreshing going on…
Through it all, FiveThirtyEight relies on WordPress to serve real-time content to its millions of visitors.
The New York Post is the fifth-most circulated newspaper in the USA, with a similarly popular website that receives over 12 million visits per month across thousands of articles.
On both the backend and frontend, the New York Post relies on WordPress to make sure those millions of people are never without their essential celebrity gossip.
As one of the world’s premier universities, Stanford University receives well over 4 million visits per month. To serve up content to prospective students and alumni alike, Stanford relies on WordPress.
You Don’t Have to Scale WordPress Alone
When it comes to scaling WordPress, you don’t have to go it alone. 93digital has the enterprise WordPress development knowledge and experience to help you scale WordPress, whatever your needs are.
To start making WordPress work for you, reach out today and let us know your goals.
WordPress Security with WP Engine & Cloudflare
Out & About: WordCamp London 2019
Do you have an exciting strategic project coming up that you would like to talk about?