Complete Guide to Optimising a WordPress Installation for Best Performance

Run a WordPress website for long enough and it will begin to show its age. Those page refreshes don’t load as fast as they used to. Bringing up the WordPress Dashboard just seems… a tad… slow.

Use WordPress long enough and a similar detritus that builds up inside of the Windows operating system will begin to rear its ugly head with this content management system too.

The kind of things that tend to gum up the works include:

  • Unused plugins and themes
  • Plugins and themes that haven’t been updated
  • Ignoring the need for frequent backups
  • Images in the gallery sitting unused
  • Lack of / poor implementation of security procedures
  • Tags that have remained unused
  • Social media sharing options littering the site
  • Shortcuts that are invalid
  • Invalid hyperlinks
  • Old post revisions
  • Spam comments not yet deleted
  • Bloated WordPress database that hasn’t been optimised since, forever…

Before Continuing On – Backup Your WordPress Installation

Before going ahead with any kind of spring cleaning it is important to create a fresh backup of the current WordPress installation. A good backup plugin like BackUpWordPress can take care of this for you.

When selecting the backup options, it is recommended that a full backup is performed rather than only selectively picking what seems the most important aspects of the current WordPress installation. Create a new, full (not incremental) backup. Store one copy locally and another in the cloud if you can.

Delete Old Plugins and Unused Themes

Locate the “Plugins” area within the left sidebar and select it. Once on the correct part of the Dashboard, locate the plugins that are not used and no longer needed.

Select them as a group, then deactivate them, uninstall the selected plugins, then finally delete them.

The plugins themselves do not take up much hard drive space from a web hosting account storage limit. However, leaving unnecessary plugins still lying around will either make updating them a chore or a task that gets skipped. When the latter is the case, the lack of updates for these unused plugins could make the site vulnerable to attack when there a known exploit out in the wild. For this reason alone, it is best to uninstall them to remove the temptation to be lazy.

For the themes, access the “Appearance” area in the sidebar and then select “Themes” from the sub menu that then appears. This will then bring up the main Themes page.

Themes are periodically added by users to try out different appearances. However, often they leave many of these installed which can take up unnecessary space.

Deactivate any theme that is still activated and no longer needed. Uninstall each deactivated theme and then delete them.

Keeping Themes Updated and Updating or Replacing Plugins

Having now deactivated and removed the unnecessary themes and plugins, it is time to take care of updating the remaining themes and plugins. This includes both the themes and plugins currently in use and the ones that were left in the system because you plan to use them sometime later on.

This process is a manual one, but it is fairly easy to do. It is possible to enable automatic background updates and reading up on this topic on the WordPress.com website could be useful here.

Keep an eye on updates for WordPress, plugins and themes. If you’re finding that certain plugins haven’t been updated in quite a while then it is likely that sooner or later this will become a problem when WordPress comes out with a major new version. Under these kind of circumstances it is a good idea to draw up a list of good alternatives to the plugins in use to enable easy switching to these plugins that are being more regularly updated.

Think About Speed & Performance

The P3 Profiler plugin is a good one to add because it can indicate how each plugin installed with WordPress is affecting performance and page loading speeds. It can certainly save you from a lot of late nights and head scratching while trying to speed up a sluggish WordPress installation.

Improving Your Site

Whilst good security can initially start with removing the more obvious risk factors by getting rid of unused code packages like themes and plugins, security in a broader sense needs to be tackled to reduce the risk factors present with any live website.

Security Plugins

Security plugins are quite often an all-in-one solution to creating a more secure WordPress. Whilst each one is different and won’t cover every single permutation and option available, there are quite a few choices that provide a great deal more security than exists with a default WordPress setup.

Changes like modifying the login page location, preventing numerous login attempts within a short period of time, and other security assists can help prevent the casual hacker from being successful.

Wordfence is a good choice for a security plugin. An alternative to Wordfence is iThemes Security (formally known as Better WP Security) which is not quite as good as Wordfence but for users who dislike the Wordfence approach to security, it represents a good second choice.

Dependable Backups Are Vital

Backup plugs are available (both free and premium versions) which can help backup different parts of a WordPress installation including posts, pages, themes, plugins, and database.

The major difference between the free and paid products is the size of the backups, the number that can be stored, and where they may be stored. With some services it is only possible to store a backup in one location unless purchasing a premium product. In other cases, only the WordPress database can be backed up.

It is important that any backup is not merely stored on the same server that the website is operated from. A local backup can be created on a home or work computer and a cloud-based option is a good idea too. Bear in mind that a local version is useful should the site have an intrusion or a data corruption which necessitates a fast replacement of the core WordPress code in order to restore the live site. A cloud-based solution is also useful, but will take additional time to first download it from the cloud (an unnecessary extra step) and then replace the corrupted live version with the cloud backup.

A number of backup plugins can back up to the cloud which often includes OneDrive, Dropbox, Rackspace Cloud, Google Drive, or Amazon S3 cloud services as supported options.

One of the better backup plugins is BackUpWordPress. Backups can be created on a regular basis and sent automatically to a chosen location or cloud service. The number of backups can be controlled so that the storage limits of a cloud account are not exceeded.

It is a good idea to perform a backup before any significant changes to the theme or plugins. This is because removing the added theme or plugin later may not always have the desired reversal effect one was expecting.

Other backup plugins that are recommended include BackUpBuddy and VaultPress.

There are alternative free backup plugins. Opinion is a little polarised with users posting comments on several free WordPress plugin support pages that paint a mixed picture regarding performance. However, even though every free backup plugin leaves one or more features out of the product either because it is not fully developed yet or it is reserved for the paid version, it is still advisable, at a minimum, to use a free backup plugin.

Removing Unused Images

It is easy enough to add images to the WordPress gallery that you expect to use some day. Often though some day never comes. Meanwhile, a considerable amount of extra space is being taken up in the WordPress database for the enlarged content folder. This has the effect of bloating the WP database unnecessarily, taking up more space with periodic backups and creating longer activity times when performing backups too.

The Image Cleanup plugin can help to locate and remote images that have not been referenced on any pages or posts yet and are essentially unused presently. The plugin sets about indexing every image across the live site so that it can determine, by cross-referencing meta data, which images are sitting in the WordPress gallery that are not being utilised. When suitable images are found, they can either be removed from wp-content or deleted altogether.

A backup folder can be used to store unused images. This way, they are out of the wp-content area which eases the operational burden for WordPress while still allowing for the possibility that the images can be moved back at a later date.

Getting Rid Of Unused Tags

Over time many more tags get added to WordPress than can be possibly used. Deleting them can be a chore especially when there are scores or even hundreds of them. The aptly-named Mass Delete Unused Tags plugin can delete all of the tags that have never been used up to this point. The plugin itself hasn’t been updated for a long while, but it still seems to function perfectly.

Hiding or Deleting Shortcodes

Shortcodes have a habit of building up inside WordPress. Often they originate from long-forgotten plugins that were once installed but subsequently deactivated and uninstalled. Many of their Shortcodes still remain though. Removing them individually would take an age.

The Remove Orphan Shortcodes plugin can remove shortcodes that are no longer needed in the WordPress installation. Targeting a specific shortcode for removal across all pages and posts is also possible by using the Unused Shortcodes plugin to extract it. Just be aware that when using the individual shortcode extraction approach it will likely result in some unusual changes to the display of pages and posts where the shortcode was previously used.

If the idea of removing individual shortcodes site-wide or as a group concerns you, why not use the Hide Unwanted Shortcodes plugin instead. This one will not remove your shortcodes which risks damaging page layout. It will hide them instead so that they do not appear in the code as a distraction.

Bringing Social Media Sharing Back Under Control

With social media being all the rage, websites owners and administrators can go a bit wild with the social buttons all over the website. This sort of thing can be overwhelming to new site visitors who may well see the overly eager request to share content as a bit excessive. As a result, they may leave even faster than they arrived, never to return.

A smart web developer will ensure that while social sharing is an integral part of a website presentation, it does not overwhelm the visitor. This is much the same way that adding some seasoning to a dish can enhance the flavours already present but it should never overwhelm the taste buds in the process. Balance is needed.

When looking for a solid recommendation for a free social media plugin, both the Floating Share Bar plugin and the Simple Shared Buttons Adder plugin come recommended.

Social Sharing by Danny is an interesting minimal alternative that has less fanfare to it but gets the job done right. On the paid side, the Monach plugin available from Elegant Themes is an excellent option too.

Fix Those Broken Links

Broken links on a website look downright unprofessional. The page describes the benefits of the product being linked out to. The interest is peaked. The site visitor clicks on the link expecting to be taken to the new site and instead receives an error message inside their web browser stating that the website cannot be found. Bummer.

Never fear though, a solution is at hand. The Broken Link Checker plugin can search the live site for all pages, posts, comments and other areas where a link might be present. Each link is then checked to ensure that it is live and not broken.

Broken links can be identified, reviewed one-by-one, corrected, ignored or marked are valid (perhaps the linked site is only down for maintenance).

The plugin will even let you pick which areas of the website to check for bad links, the types of links to check (internal, external, etc.), and offer either ongoing or occasional monitoring options. The one potential downside to using this plugin is that is does eat up server resources while it’s running so it should be used during times when traffic is low.

An alternative option which doesn’t use up server resources is the W3C Link Checker on the W3C website.

A relative newcomer is the Broken Link Manager plugin. With this plugin it is possible to check for broken links, monitor for new broken links, and organise them. With the organising part, one can setup various types of redirections like a 301 redirect to a different web page. A default redirection can be configured for all broken links to provide a single solution to a site-wide problem.

Certainly a newer plugin, but one to watch carefully.

Deleting Multiple Revisions

Each time a post is written up and then saved, it gets a new revision saved too. In many cases, a single post can end up with 5+ revisions or even more before the final version is accepted. With evergreen posts that are periodically updated, the number of saved revisions continues to grow as time passes.

This process is helpful for writers and site owners who can access the history of revisions over time, but it can be costly on disk space used. Even backups can get padded out to include all the revisions over time stored in the WordPress database.

What is needed is an efficient way to delete the old revisions that are no longer required. The Better Delete Revision plugin is one such way to accomplish this. It can delete the meta data, tags, post revisions, and remove any connection between a revision and the WordPress database.

One of the downsides with using the Better Delete Revision plugin is that it won’t delete revisions for posts that are published, scheduled to be published or still sitting as drafts. For a pure-play revision deletion plugin, this one is your best choice.

Another plugin option is RVG Optimise Database which includes many more functions than the Better Delete Revision plugin does.

Revision Control is an interesting plugin that lets the user determine how many revisions are allowed for posts and pages. Revisions for posts and pages can also be individually enabled or disabled providing a greater degree of granular control over revisions within WordPress than previously possible.

Tackling Spam Comments

Blog engagement is great, but quite often the comments are generated by spam bots and spammers who are using comments to generate backlinks to their chosen target URL. In the case of commenting about certain undesirable topics, this can seriously affect the ranking of the site on Google. Comments need to be carefully managed to remove or prevent spam ones from being posted in the first place.

Depending on the size of the audience, websites can be recipients of hundreds or thousands of spammy comments daily. Cleaning up these comments so that they do not take up unnecessary space or cause disruption for the site is quite important.

The Spam Comments Cleaner plugin can delete comments on a regular basis. It is possible to specify exactly how often the plugin will delete spam and it can then run on its own.

When needing to handle both spam comments and tidy up post revisions across multiple sites then you might wish to consider using the premium Manage WP solution to take the pain out of the process.

Optimising Your WordPress Database

What ties everything together with WordPress is the database that drives it all. There are dedicated plugins to work on improving database performance. There are also plugins that perform a variety of useful functions including managing the WordPress database efficiently for better performance.

WordPress runs via the database. Want to display a page of content? The content and everything that connects and intersects with it originates inside the WordPress database. A modern, streamlined database will perform better under stress than one that is bogged down with inefficiencies.

WP-Optimize

WP Optimize is an optimisation and clean up plugin tool for the WordPress database. It can remove trackbacks and linkbacks, remove posts, and delete spam comments and comments not yet approved for publication. Automation is also possible with a weekly, bi-weekly or monthly schedule to address WordPress database issues regularly.

Worth noting is that the above plugin displays a number of options in a red colour. These should not be used unless you are an expert at database optimisation inside WordPress. In any case, it is strongly advised to perform a full backup before optimising a WordPress database in order to avoid disaster.

WP-Sweep is another plugin that addresses some WP database issues. It can remove duplicate, orphaned or unused data to crunch the size of the database down to a more manageable size.

Notable about this plugin is that it uses WordPress delete instructions rather than using direct MySQL queries. This has the result of a better clean up process than some other WP database clean up tools.

WP-DB Manager is a final database optimisation tool that also doubles as a backup option for the database itself.

Closing Remarks

Optimising a WordPress installation for best performance is often about cleaning up past messes so that the future can be brighter. This can be readily achieved by using various plugins that can remove remnants of past activity in a fast, efficient manner.

Backups are required in order to stay safe from unpredictable events and in a worst case scenario, total website loss due to a hack or data corruption. These can sometimes, not always, be combined with a spring cleaning of the WP database in order to help it perform more efficiently.

A number of the plugins mentioned in this article can be setup to run periodically. Others can be activated in time for scheduled maintenance and later deactivated again to reduce the total number of active plugins running with WordPress.

No Comments

Leave a reply