Optimise WordPress Print

  • 0

Is your WordPress site markedly slow? Or have our Technical Support team informed you that your Managed or Self-Managed server is experiencing high load which has a negative impact on server performance? Has your site been moved to one of our quarantine servers due to load issues in order to ensure optimal server performance for our other customers?

Consider the aspects below to optimise the performance of your site or server.

There are various tools available for testing your website’s speed and performance, such as PageSpeed Insights (from Google) and Pingdom. Use these to determine which aspects of your site or server needs some fine tuning.

Here are some aspects to investigate:

  1. Caching

In most cases, caching is the most effective way to speed up your WordPress website, by reducing unnecessary reloading of pages. Caching creates static HTML versions of each website page which reduces the number of database queries or execution of PHP code, reducing the number of server requests.

These are popular WordPress caching plugins (only use one):

  1. Plugin cleanup

Too many plugins, or some specific plugins, can drastically impact your site’s performance. This can be caused by:

  • Additional HTTP requests. Some plugins add extra JavaScript and CSS file requests, causing higher server load.
  • Database-intensive queries. Inefficient or complex queries can cause significant load times and poor performance.
  • Plugin conflicts. Some plugins interact badly with other plugins or WordPress themes, causing performance issues.

P3 (Plugin Performance Profiler) or WP Performance Profiler are useful tools which highlight the effect that each plugin adds to your page loading time. Certain plugin types store more data than others in the database and can be the culprit that is placing high load on the CPU:

  • Antispam plugins e.g. Akismet
  • Backup plugins e.g. Backup Buddy
  • Link tracking plugins
  • Statistics plugins
  • Security plugins
  • Related Posts or Popular Post plugins

How to fix it:

Use systematic testing to isolate culprit plugins: deactivate them all and then reactivate one by one and run the test again. Note that even if deactivating a plugin improves performance, it may not be that specific plugin that is the culprit, but rather a conflict with another plugin.

  1. Optimise the database

As your site grows, so will the database that runs it. Over time a lot of unnecessary data starts to bloat the database and maintenance is needed to keep it at an optimal performance level.

How to check it:

Query Monitor is a plugin which provides debugging and performance information on database queries, hooks, conditionals, HTTP requests, redirects and more. It highlights slow queries in red, which helps you to quickly identify problems.

If our Technical Support team inform you that it appears that high load issues are caused by database queries, then a debugging plugin like Query Monitor could help you to isolate the cause of the issue.

Factors that can unnecessarily increase the database size are

  1.  
  • Certain types of plugins (see Plugin Cleanup above)
  • Spam comments
  • Revisions
  • Autosaves
  • Unused plugins and themes

How to fix it:

Plugins such as WP-optimize or Autoptimize or WP-sweep are great for cleaning up unnecessary data – but first create a complete WordPress backup of your site as changes made during cleanup are irreversible.

While the WordPress database is indexed by default, high server load is sometimes caused by poor database queries which may be resolved by additional indexing. There is no quick fix, though – the problem queries need to be addressed specifically.

However, what appears to be a database problem may not be; it may be a bad loop in a plugin that causes a good query to run too many times. Before trying further indexing, first do a plugin cleanup, and test plugins by deactivating them all and then reactivating one by one.

For further information: Finding and Fixing Slow WordPress Database Queries

  1. Optimise images

Large, or poorly optimised images is a common reason for slow websites. They take up unnecessary space, add strain on the server and take a long time to load.

The aim with image optimisation is to find the best balance between image quality and file size: the file size of very high quality images is too large and causes slow loading, but fast loading small images may be of poor quality.

How to fix it:

  • Ensure the images are in the correct file format
    • Photographs or a complex images with lots of detail and colors should be JPEG.
    • Screenshots, illustrations, or images with lots of text are best as PNG.
    • For simple animation (but you don’t want to embed a video player), use GIF.
  • Crop the image to focus on what is important. This reduces file size.
  • Resize to a pixel width that is suitable for viewing e.g. 600pixels. Resizing should be done before uploading –although WordPress allows the option of displaying smaller versions, the full sized version is stored.
  • Compress images using tools such as WP Smush ,  TinyPNG or CompressPNG/JPG
  1. Optimise Video

Use Lazy Load for Video to speed up your site by replacing embedded Youtube and Vimeo videos with a clickable preview image. By loading the videos only when the user clicks on the preview image, using jQuery, no unnecessary JavaScript is loaded.

  1. Disable WP-cron

WordPress has a file called wp-cron.php that runs every time someone visits your site, which can severely throttle CPU usage and slow down busy sites.

Rather than letting wp-cron slow down your site, it should be disabled and let your system handle scheduled processes in the background — using a cronjob.

Disable wp-cron in WordPress

  1. Use FTP to access your server and navigate to the public_html folder
  2. Add this line at the bottom of your wp-config.php file

define(‘DISABLE_WP_CRON’, true);

Enable a real cronjob


Was this answer helpful?

« Back