When building and maintaining WordPress websites, it’s important to find ways to improve site performance and decrease page load times. This helps reduce bounce rates and increase rankings on search engines.
However, we can’t control the content – specifically images – that clients will add to their WordPress web site. Images may be uploaded in their original form, leading to site performance issues and increasing page load times.
In this article we will explore different ways of optimizing JPEG and PNG images, which are uploaded by clients and site owners into WordPress.
When a WordPress user uploads an image, WordPress provides two functions which we can use to create copies of the original image, at specific dimensions. This is useful where we want to output an image at a specific size within our theme.
Within the WordPress Administration, under Settings > Media, there are three predefined image sizes:
large. Each can have their own dimensions set.
Because WordPress will always resize images to these sizes (resulting in 4 images being stored – the original, thumbnail, medium and large sizes), it’s worth setting these first and using them within your WordPress Theme where possible.
Copy and paste this URL into your WordPress site to embed
Copy and paste this code into your site to embed