WordPress – High CPU usage

last updated 8 months ago

High CPU usage on a WordPress website can lead to slow performance, error messages, and even the suspension of your hosting account. In this tutorial, we'll explain the most common causes of high CPU usage and how to fix them efficiently.

1. Causes of high CPU usage

High CPU usage on a WordPress website can be caused by a variety of factors, including:

  • Too many or poorly optimized plugins and themes
  • Large and unoptimized images
  • Missing caching mechanisms
  • Attacks by bots and crawlers
  • Unoptimized database queries
  • High traffic without appropriate resources

Excessive CPU usage in WooCommerce stores can have many different causes that affect the online store's performance. This often results from a large number of concurrent visitor requests that strain server resources.

Too many plugins and themes that aren't optimally programmed or offer a lot of features can also require a lot of processing power. Inefficient database queries, large images, or poorly optimized product pages can also place additional strain on the CPU. Server overload can lead to slower loading times and poor user experiences, which can ultimately negatively impact sales.

2. Server and hosting review

Before you begin optimizing your WordPress site, check your hosting provider's resources. Shared hosting environments are often insufficient for large WordPress sites with high traffic. Important:

  • Monitor CPU usage in the hosting dashboard
  • Make sure the hosting package provides enough RAM and CPU power.
  • Consider switching to a VPS or managed WordPress hosting.

3. Optimizing the WordPress database

A neglected WordPress database can lead to excessive resource consumption. Plugins like WP Optimize or WP sweep help clean up the database to:

  • Delete revisions and drafts
  • Remove spam comments
  • Clean up transient options

Attention: Create a backup first!

4. Very important: Use caching

Caching is one of the most efficient ways to reduce CPU usage. There are several caching methods:

  • Browser caching: Sets the cache duration for returning visitors.
  • Page caching: Stores static HTML versions of the pages.
  • Object caching: Saves frequent database queries.

Recommended plugins for caching are WP Super Cache, W3 Total Cache or WPRocket.

Here you can read more about my tested WP Cache plugins:

https://blitzwp.de/wordpress-cache-plugins/

5. Plugin and theme optimization

Plugins and themes can consume a lot of CPU resources. Here's how to optimize this area:

  • Deactivate and delete unused plugins.
  • Light and well-programmed themes like Astra or GeneratePress to use
  • Plugins on high resource load with Query Monitor check

If possible, avoid themes that use Elementor.

6. Image optimization

Large and unoptimized images can increase CPU load by slowing loading times. Steps for image optimization:

  • Image compression plugins like Smush or Imagify to use
  • Use the WebPformat for better compression.
  • Enable lazy loading for images.

7. Dealing with crawlers and bots

A frequently overlooked reason for high CPU usage is bots and crawlers. They can place a heavy load on the server through repeated requests. Be sure to use a robots.txtto block specific bots:

User agent: BadBot
Disallow: /

User agent: *
Crawl delay: 10

Alternatively, you can achieve the same results with the right Cloudflare settings.

Here's a guide from me on how to write the best robots.txt for Woocommerce!

Here is a guide from me on how to create the optimal robots.txt for WooCommerce!

8. For shops: Optimizing WooCommerce

WooCommerce is resource-intensive and therefore requires special attention:

  • Use specialized WooCommerce plugins that are optimized for performance.
  • Limit the number of products and variations on each page.
  • Enable WooCommerce caching via specialized caching plugins.

9. Block crawlers with robots.txt for WooCommerce

https://blitzwp.de/optimierte-robots-txt-fuer-woocommerce/

An important aspect of reducing CPU usage is blocking unnecessary crawlers. For more information, see my post: Optimized robots.txt for WooCommerceThere you will learn how to robots.txtfile to exclude unwanted bots.

Summary & End

High CPU usage can have many causes, from hosting issues to unoptimized WordPress configurations. By following the steps above, you can significantly improve the performance of your WordPress site and sustainably reduce CPU usage.

Content

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    lk media – your partner for online marketing & web design.

    Your success online is what drives us.
    lkmedia white
    Agency for future-oriented online marketing and web design. We are a team of creative minds and strategic thinkers who are passionately committed to your success in the digital space. Our goal is to present your brand optimally, reach your target group and generate sustainable growth.
    © Copyright 2024 lkmedia
    Sitemap Data protection imprint
    en_USEnglish