cPanelOps · Hosting guides for site operators
cPanelOpsv2.2.0
Plain-English cPanel help from the team behind FirstResponderHost
26 guides live
CpanelOps / PageOps

Home › Guides

Performance

Keeping a WordPress news site up during a traffic spike

Breaking news can send a month of visitors in an hour. The settings that decide whether shared hosting copes, in the order that matters.

Local news and public-safety sites have an unusual traffic pattern: quiet for days, then a single post is shared widely and thousands of people arrive at once. Shared hosting can handle far more than people expect, provided the server is not rebuilding every page for every visitor. Almost everything below is about that one idea.

1. Serve cached pages to visitors who are not signed in

Without a page cache, each visit makes WordPress run its code and query the database. With one, the finished page is saved and handed out as a plain file, which is many times cheaper. This is the single change that matters most.

  • If your host runs LiteSpeed, install the LiteSpeed Cache plugin. It talks to the server's built-in cache and needs little setup beyond switching it on.
  • On other servers, use an established page-cache plugin and enable page caching for logged-out visitors.

Then test it: open a post in a private window and look at the response headers in the browser's developer tools. A cache plugin adds a header that says whether the page was a hit or a miss. The second load should be a hit.

VisitorPage cachesaved copy?Saved pagesent at onceyes: cache hitWordPress + databasebuild the pageno: cache misssaved for the next visitor
On a busy day you want nearly every visit to take the top path.

2. Remove the things that defeat the cache

Some features force a database query on every view, cached or not:

  • View counters and "most popular" widgets that record each visit.
  • Plugins that call back to the server from every page for live counts or notifications.
  • The built-in task runner. WordPress checks for scheduled tasks on page loads. Switch that off in the configuration file and run the task file from a real scheduled job every 15 minutes instead.

On a spike day, the widget that seemed harmless at fifty visitors an hour is the thing that takes the site down.

3. Make each page lighter

  • Resize images before uploading. A phone photo is often several megabytes; the page needs a fraction of that.
  • Lazy-load embeds. Audio players, maps and social posts each pull in their own scripts. Load them when the reader scrolls to them or clicks.
  • Trim plugins. Each active plugin can add scripts to every page. Remove what you do not use.

4. Put a CDN in front for the static files

A content delivery network keeps copies of images, stylesheets and scripts on its own servers and delivers them from there, so those requests never reach your hosting account. Free plans are enough for most small sites. Make sure it is set to connect to your server over HTTPS.

5. Know your account's limits

Shared hosts cap each account's processor time, memory and number of simultaneous PHP requests. When a cap is hit, visitors see a 503 or 508 error even though the server itself is fine. cPanel's Resource Usage page, where the host provides it, shows whether you have hit a limit and when. If you hit them on ordinary days, no amount of tuning will carry a spike; it is time for a bigger plan.

6. Have a plan for the day itself

  • Keep the breaking post simple: text, one sized image, no heavy embeds until the rush passes.
  • Do not clear the whole cache in the middle of a spike. Every page then has to be rebuilt at the worst moment. Purge only the post you edited.
  • Avoid updates and plugin changes until traffic is back to normal.
  • If the site does fall over, a plain HTML page with the key facts and a link to your social page can be put in place in a minute, and it will stay up under any load.

Rehearse once

Pick a quiet evening, turn caching on, and walk through the site in a private window checking that pages are served from cache, that comments and forms still work, and that the admin area is not cached. Finding a misbehaving setting on a quiet night costs nothing.

Common questions

Will caching show visitors an old version of a breaking story?

Cache plugins clear a post's saved copy when you update it, along with the home page and archive pages that list it. Readers get the new version on their next load. What they will not get is a change you made by editing the database or theme files directly; purge the cache yourself after that kind of change.

Does caching break comments or logged-in features?

Page caches skip visitors who are signed in or who have just commented, so those people always see live pages. Problems come from features that personalize a page for anonymous visitors, such as a greeting by city. Either exclude those pages from the cache or load the personal part with a script after the page arrives.

How much traffic can shared hosting take?

There is no single number, because it depends on the plan's limits and on how heavy each page is. With full-page caching working, the limit is usually set by how quickly the server can hand out saved files and images, which is far higher than most small sites ever reach. Without caching, a few dozen simultaneous visitors can be enough to hit the account's limits.

Spotted a mistake, or a step that has changed?

cPanel's screens differ a little between versions and hosts. Tell us at info@firstresponderhost.com and we will correct the guide.

More guides