SRCSET – gmetrix / function

https://www.smashingmagazine.com/2016/09/responsive-images-in-wordpress-with-art-direction

https://novo-media.ch/en/web-optimization/responsive-images-wordpress/


PLUGINS

https://wordpress.org/plugins/cdn-rewrites/

https://wordpress.org/plugins/wp-migrate-db/
Just a note — I used the WP Migrate DB plugin’s Find/Replace function (with the Update GUID option checked in the advanced options) to update the previously existing urls in the database to the CDN. I discovered that doing a simple find/replace in the SQL (either by hand or via a find/replace plugin) without updating the GUIDs will result in broken images and lots of problems, as the GUID serves as a security feature. Anyway, just in case anyone else runs into a similar problem, that’s how I resolved it. Hope to save you some headaches.

https://wpsynchro.com/?gclid=EAIaIQobChMIlMDV8-jK6gIVJBh9Ch0MWgYhEAAYAyAAEgJ0N_D_BwE

https://github.com/2aces/wordpress-srcset-cdn

http://blog.futtta.be/autoptimize/


FUNCTION
https://wordpress.stackexchange.com/questions/270010/change-image-url-to-a-cdn


https://wordpress.stackexchange.com/questions/49578/a-way-to-change-image-urls-in-post-to-cdn-image-url
You can parse via regex for images in the_content; but is always load and slowly. Maybe you change the url of images, after post_save in database or change the current posts inside the database and create an custom CDN. Its the fast way and all caching plugins has the break, that she must parse the content. For background an custom CDN in WP see this answer.


MULTISITE

Basic answer to “what plugin” would probably be W3 Total Cache. It is one of the most functional and actively developed plugins at moment. However complete performance chain is much longer that WordPress plugin alone can handle.

Web server (Apache or something else) configuration (response time, time to first byte, headers).
Database (time spent processing queries).
PHP/WordPress (page generation time, memory consumption).
Front-end performance (amount of HTTP requests, bandwidth).
Good start would be static caching plugin (like W3) with opcode memory-based cache like APC.

But from there there are way more (and way more complex) things you could do, like content distribution networks, alternate web servers, etc.

https://wordpress.stackexchange.com/questions/2490/what-is-the-best-caching-option-for-wordpress-multi-site-on-non-shared-hosting/2494#2494


https://the.shawneee.com/wp-migrationv2-notes-quick/3/


https://www.keycdn.com/blog/optimize-images-for-web

Optimize Images for Web

By Martin Williams Updated on September 17, 2019

When it comes to marketing your website, there are a lot of different aspects to consider, such as speed, SEO, conversation rates, bounce rate, and many others. We normally focus solely on the performance aspect, but today we want to dive into additional ways you can optimize images for the web. The file size of your images of course is very important, but SEO and social media also play an important part in helping your website perform and convert better.

Below we will discuss the three areas in which you can better optimize images for web:

  1. How to optimize images for better web performance.
  2. How to optimize images for SEO to rank and index better in search engines.
  3. How to optimize images for social media for better engagement and CTR.

1. Optimize images for performance#

When it comes to optimizing images for performance there are a lot of things you can do, such as scaling, compression, using responsive images, serving from a CDN, and choosing the right file format.

Image scaling#

When it comes to working with images, starting from the basics can be very important, and we are referring to how images scale. Most of you have probably seen the following Google PageSpeed Insights optimization suggestion at one point or another when running a speed test:

By compressing and adjusting the size of … you can save 14.2 KB (54%).

This recommendation refers to your images being scaled down from the original dimensions, either through CSS or an HTML attribute. For example, this would occur if an image being served has an original width of 1460 pixels but is being served at 730 pixels to fit in the container that it has been placed in. This can be a problem in a lot of content management systems such as WordPress or Magento, because theme developers tend to scale images down in responsive themes using CSS.

optimize image scale

It is usually recommended that you upload images at scale. This means cropping images before being uploaded, which will save resources and also will keep you compliant with the PageSpeed Insight guidelines. Alternatively, you can upload multiple resolutions of your images and serve the right resolution for the right device.

Image compression#

Just how much of a website is made up of images? Well, according to HTTP Archive, as of June 1, 2019 the average desktop page is 1,896.8 KB and the average mobile page is 1,683.5 KB. This means 51% of the average bytes per page, whether on desktop or mobile, are solely made up of images. We found that 46% of the experts said that the number one priority or focus should be on image optimization!

An easy way to compress images is with our image processing service that happens to also be fully integrated into our existing network. It allows comprehensive on the fly image transformation and optimization. Images can now be compressed in real time with simple query parameters and will then be delivered by our CDN.

Alternatively, take advantage of smart image compression with the Optimus image optimizer. This is a powerful WordPress plugin and image compression API that can reduce the size of images without any visible loss in quality. WebP conversion is supported with a paid license. Optimus allows images to be optimized and then stored. This is useful if you want to store optimized images instead of using a real-time image processing service.

Depending on the image and format, reductions in size of up to 70% are possible. Optimus can be installed on any WordPress website or you can make use of the API to be used on any platform. The PHP library for the API is available on GitHub.

By using Optimus you can also fix the following PageSpeed Insights optimization suggestion:

By compressing … you could save 4.7 KB (30%) without losses.

Responsive images#

Responsive image techniques, such as the srcset, sizes, and media HTML attributes, allow different scaled images to be delivered based on the size and resolution of the accessing device. This allows you to further optimize your image delivery to improve the overall performance of your website or application.

For example, below is the markup for an image that would not be responsive:

<img src="/img/blog/responsive-images.png" alt="responsive images">

Now, adding the responsive attributes would allow the browser to select and serve the defined image when certain conditions are met:

<img sizes="(min-width: 1200px) 730w,
            (max-width: 1199px) 610w,
            (max-width: 380px) 350w"
     srcset="/img/blog/responsive-images-lg.png 730w,
             /img/blog/responsive-images-md.png 610w,
             /img/blog/responsive-images-sm.png 350w"
     src="/img/blog/reponsive-images.png"
     alt="responsive images">

If you are running WordPress, these are now part of the core since WordPress 4.4, so you don’t have to worry about adding them. KeyCDN’s Cache Enabler plugin is fully compatible the HTML attributes that make images responsive.

Image CDN#

Using a content delivery network like KeyCDN, or what we also call an image CDN, can be one of the easiest and fastest ways to speed up the delivery of your images. The main reason is because it decreases the latency to the user where they are located by serving your images from a POP physically closest to them. It also allows for additional control over the caching of your images as well as hotlink protection.

We ran some image CDN tests and the results were that the total download times on our image assets with a CDN enabled decreased by 65% on average! The TTFB and the content download times were the two greatest factors decreased by implementing a CDN.

File formats – PNG, JPEG, WebP, and SVG#

One of the final ways you can optimize images for web performance is to have a good strategy for the file formats you use. PNG and JPEG are the most commonly used image file formats on the web. However, there are two other formats that you should also be considering, and that is WebP and SVG. These are by far the smallest in size and can do wonders to reduce your total web page size.

WebP#

WebP is an image format developed by Google to ensure superior compression of photos. In fact they even use WebP themselves on websites like YouTube. We ran a test in WordPress with 5 large JPEG images to demonstrate how much compression actually takes place when converted to the WebP format and the significant size difference between the two formats. We are using lossless compression with Optimus to optimize the images and also convert to WebP format upon upload to the media library. The Cache Enabler plugin then delivers WebP images based to supported browsers.

File name Original size Compressed JPEG WebP format Size difference
jpg-to-webp-design-assets/ago-no-category/1.jpg 480 KB 407 KB 43 KB 89%
jpg-to-webp-2.jpg 659 KB 578 KB 113 KB 80%
jpg-to-webp-3.jpg 787 KB 715 KB 127 KB 82%
jpg-to-webp-4.jpg 617 KB 543 KB 61 KB 88%
jpg-to-webp-5.jpg 605 KB 543 KB 70 KB 87%

We then ran a page comparison test with GTmetrix, JPEG vs WebP, and you can see the total difference in page size. WebP resulted in a 77% decrease in page size.

jpeg to webp

SVG#

Scalable Vector Graphics (SVG) allows vector graphics to be displayed in the browser. They are commonly used for company logos, such as the KeyCDN logo you see at the top of this website. SVG files have a very small file size, can be scaled losslessly without increasing the file size, and can be animated or altered with JavaScript. Another advantage of SVG images is that they can be compressed by Brotli or Gzip.

When it comes to using SVGs you can include them just like you would any other image, for example:

<img src="/img/blog/example.svg">

However, this can get a little trickier if you are using a content management system like WordPress, as this type of file is not permitted for security reasons.

svg not permitted wordpress

You can use a free plugin like SVG Support or Add Full SVG Support to allow you to be able to upload SVGs into the WordPress media library.

2. Optimize images for SEO#

When it comes to optimizing images for SEO there are a lot of things you can do, such as naming your images strategically, using the right alt text, image sitemaps, and ensuring that they are indexing properly with search engines.

Image file names#

When you name your images you should always keep in mind that search engine bots and crawlers are responsible for seeing them. You can’t expect a computer algorithm to be perfect or guess what your image is, so that is why it is recommended to name your image file names something similiar to your post’s content and or keyword you are focusing on.

For example, on this article, our featured image is named “optimize-images-for-web” because that is the topic of this article. Always use hyphens when there are multiple words. Search engines, such as Google, sees hyphens as a separator. Don’t use underscores, otherwise Google will read everything as one word.

Image alt text#

Alt text, also referred to as alt tags, describe the image and purpose for it on the page. Generally you will want it to be short yet descriptive. See example again below of our featured image and the alt text we chose. A lot of times this might be similiar to the file name you choose.

<img src="/img/blog/optimize-images-for-web.png" alt="optimize images for web">

The alt text is also used by screen readers, the browsers used by blind and visually impaired people, to tell them what is on the image. Every image on a page should have alt text. Google also places a high value on them to determine how your image ranks and is related to the content on your page. If you are using a content management system like WordPress there is a field to input the Alt Text when you upload your image. Otherwise you can simply include them in your HTML as seen above.

wordpress alt text

Image title tags#

The image title attribute, also referred to as title tags, are not required by Google. However there has been some debate about this recently over on Search Engine Roundtable in a post called Google Does Index & Rank Images Title Attribute Tags. Dawn ran a test with the word “plinkyploppitypippity” in the title attribute field and left the alt text empty. A few days later she found that Google had indexed her image for that term.

Now there are a few more things to consider here before going back and adding title tags to all your images. First, Google most likely puts higher priority on the alt text anyways, so even if you had both, the title attribute might not matter. A second thing to consider is that she used the term “plinkyploppitypippity” in her the body content of the post, which means it’s possible Google may have associated her post content with the image and indexed it.

If in doubt, you can add the title tag, as it won’t hurt anything. But don’t expect to see any gains either.

Image sitemap#

Image sitemaps provide information that helps Google discover images that they might not otherwise find (such as images your site reaches with JavaScript code), and allows you to indicate images on your site that you want Google to crawl and index. Sitemaps aren’t necessarily required if your website is setup properly, but by using them it can also help you diagnosis problems with your site and dig deeper into the data.

For example, you can check if your images are indexed by looking at the sitemap data in Google Search Console or by using the site search operator in Google. In this example we are using WordPress and the Yoast SEO plugin to create and submit our sitemaps. You can also use a third party tool like xml-sitemaps.com.

  1. In Google Search Console click into “Crawl” and then “Sitemaps”.
  2. Then click into your “Images” tab and you can see the number of images indexed out of the total submitted, within each of your sitemaps.

Indexing images#

When it comes to Google finding your images you definitely want to make sure they are indexing properly. One way to help troubleshoot that is to use a sitemap file like we described above. Another is to ensure that the settings on your server and or CDN are setup correctly. Search engines check for a robots.txt file at the root of a site. If the file is present, they will follow the instructions but if no file is present, they will scan everything.

Here is a typical robots.txt file that allows everything. Typically that is enough to ensure your images are crawl-able.

User-agent: *
Disallow:
  1. The first line defines the crawler the rule applies to. User-agent: * would apply for all bots, such as Googlebot, Bingbot, etc.
  2. The next line defines what path can be indexed. Disallow: tells the search engine to index everything.

When you throw a CDN into the mix there are a few additional things you have to enable. Since a CDN copies your assets you need to tell Google that. You can do that by adding a canonical header which lets the Google crawler know that the content from the CDN is a copy. Once you add rel="canonical" to the HTTP header, your images will index normally as the crawler will know that they are only a copy and not duplicate content.

canonical tag

If you are using WordPress and your CDN images start to get de-indexed from your Google Search Console account, this is likely a sitemap structure issue. Assuming you are using the Yoast SEO WordPress plugin, you may need to add a snippet at the top of your functions.php file.

Another thing to consider if you are using Yoast is that sometimes your image attachment pages might start indexing. Each image you upload to WordPress is housed on it’s own attachment page URL. You definitely don’t want people seeing those, especially Google. One way to quickly fix this is to simply go into the Advanced Yoast SEO settings and enable the “Redirect” for attachment URLs.

yoast redirect attachment URLs

3. Optimize images for social media#

When it comes to optimizing images for social media there is a lot you can do to improve your CTR and engagement such as ensuring that you setup Facebook open graph META tags, Twitter cards, Pinterest rich pins, and Google Snippets. It is also important that you size your images correctly.

Facebook Open Graph meta tags#

Facebook Open Graph meta tags control how your content appears on Facebook. When you share a post to Facebook the tags tell Facebook what to set for your URL, title, description, and one of the most important parts, your image. See example below of a post on our Facebook page from our blog.

facebook open graph meta tag

There are a lot of different meta properties that you can use but these below are the most important ones.

<meta property="og:url" content="https://www.keycdn.com/blog/resource-hints">
<meta property="og:type" content="article">
<meta property="og:title" content="Resource Hints - What is Preload, Prefetch, and Preconnect? - KeyCDN">
<meta property="og:description" content="Check out how you can use resource hints and directives such as preload, prefetch, and preconnect, to speed up delivery of assets on your websites.">

These can easily be added to any static site manually or if you are on a content management system like WordPress, Yoast is a great free plugin that can add these tags for you automatically. Just make sure they are enabled under the Social settings of the plugin.

yoast open graph meta data

A recommended image size that works well for Facebook is 1,200 x 630 pixels. With the Yoast plugin in WordPress you can actually manually set the OG properties. This is useful if perhaps your WordPress theme uses one size for a featured image, but you still want your Facebook image to look pixel perfect.

facebook custom image

Twitter cards#

Twitter cards work very similiar to the way Facebook Open Graph meta tags work. They are used to show the preview part in a tweet. There are four primary types of Twitter cards:

  • Summary Card: Title, description, thumbnail, and Twitter account attribution.
  • Summary Card with Large Image: Similar to a Summary Card, but with a prominently featured image.
  • App Card: A Card to detail a mobile app with direct download.
  • Player Card: A Card to provide video/audio/media.

Below is an example where someone tweeted a URL from our blog and Twitter then had to rely on our Twitter card to pull the large image and summary.

There are different meta name properties per different Twitter card type. Below is an example of the code for a Summary Card with Large Image.

<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@KeyCDN">
<meta name="twitter:creator" content="@KeyCDN">
<meta property="og:url" content="https://www.keycdn.com/blog/pop-in-helsinki">
<meta property="og:type" content="article">
<meta property="og:title" content="KeyCDN Launches POP in Helsinki - KeyCDN">
<meta property="og:description" content="KeyCDN is dedicated to global expansion and development. We're excited to announce that we're establishing our presence in Finland with a POP in Helsinki.">

These can easily be added to any static site manually or if you are on a content management system like WordPress, Yoast can add these tags for you automatically. Just make sure they are enabled under the Social settings of the plugin.

yoast twitter card large image

A recommended image size that works well for Twitter is 1,024 x 512 pixels. Again, in the Yoast plugin in WordPress you can actually manually set the meta name properties.

yoast custom twitter card

Pinterest rich pins#

Pinterest has what they call rich pins. There are currently 6 different types of rich pins: app, movie, recipe, article, product and place. They actually use Open Graph metadata just like Facebook. So if you have those tags on your site already you should be good to go. However, you do actually have to apply once to use rich pins.

  1. Go to the Pinterest URL validator.
  2. Validate a URL from your site. Any URL that has the Open Graph metadata on it.
  3. Click on “Apply” if everything is setup correctly.

Once you click apply, you should get an email within a few minutes. Then rich pin data will start to show up on Pinterest. Here is an example below of different pins people have pinned from our site.

pinterest rich pins

Summary#

As you can see there are a lot of different ways you can optimize images for web. It’s not always just about web performance, even though we are usually a little biased on that front. But when it comes to marketing the speed, SEO, and social media all play an important role in how successful your site and or brand is on the web. Have other image optimization tips that perhaps we missed? Feel free to comment below!


https://gtmetrix.com/blog/how-to-optimize-images-a-practical-guide/

How to Optimize Images: A Practical Guide

Want to know how to Serve Scaled Images and Optimize Your Images? We’ll show you how!

As a conclusion to our What Does Optimizing Images Mean? post, we’ll show you how to actually solve your image optimization woes. This walkthrough is general enough to apply to most websites and platforms.

NOTE: This is just one way to scale and compress your images. There are many other methods that would work just as well.

Here’s how to get your images scaled and compressed:

 


 

Step 1) Analyze your site with GTmetrix

When the report is complete, look at your PageSpeed tab and click on “Serve scaled images

The section will expand and show you a list of images that need to be scaled.

Click on the Serve scaled images recommendation to see a list of images that need scaling.

 

In this example, we’re serving an image that’s 2000×1095, but being scaled to 524×287. We can reduce the filesize significantly if we serve a more appropriately sized image.

Take note of the image name, and find where it’s being displayed on your site.

 


 

Step 2) Find out the maximum display size of the image

In other words, determine how large that image could potentially get.

Most likely, your site is responsive. You’ll need to figure out what size the image needs to be served at.

Resize the browser (In this guide, we’re using Chrome) and take note of “break points” where your image resizes suddenly.

The sudden resize in your image indicates a “break point.”

 

Many responsive themes have multiple break points, so keep doing this until you see the largest size the image is displayed at. Generally speaking, this is the maximum size your image needs to be. To find out exactly what pixel dimensions it is:

Right-click on the image and click “Inspect(“Inspect Element” in Firefox and “Developer Tools” in Edge)

Developer Tools” will appear, and the code for your image will be highlighted, and if you hover over the URL, you’ll see the dimensions it’s served at, and it’s “Natural” size.

 

Hover over the highlighted URL of your image and you’ll get the scaled size and Natural size of your image. Above example using Chrome.

 

The “Natural” size is the actual dimensions of the image. This is what your users are downloading.

Take note of the first dimensions you see (in this case it’s 628×344) – we’ll call this the maximum display size.

 

Important things to note

  • If your image always follows the browser resizing, even at a maximized screen, it means that image is likely within a container that has no maximum display size.
    • The best thing you can do is export at your best perceived quality and compress the image for filesize savings.
    • This image may trigger the “Serve scaled images” recommendation, but unless you change your site design to have a max-width, you cannot address this issue.
  • If the image doesn’t change size when you resize the browser, it means it’s likely already at its maximum display size
    • Take note of those dimensions and rescale your image accordingly.
  • If you cannot find your image URL, it means it’s most likely a background image (displayed via CSS) or JavaScript is doing something with it.
    • Using the “Inspect” function, check the CSS panel to see if your image was placed there via “background:”

      Use the Inspect tool to get details for background images.
    • Click on the container that the image is displayed in – in this case it’s 
      <header class=”blog-header”>…</header>
    • Look to the right and you’ll see the class “blog-header” having a “background-image” – You can confirm this is indeed the correct image by right clicking on the URL and opening it in a new tab.
    • Take note of the container size (yellow) on the screen – in this case it’s 683×166 – These are the dimensions you’ll rescale your image to.
  • If you’re using WordPress, you may see “srcset,” along with a list of image URLs.
    • Later versions of WordPress automatically use “srcset” to deal with overly scaled images.
    • You shouldn’t need to do anything here, as the WordPress theme should deliver different sized images at different screen resolutions.
    • We’ll likely discuss “srcset” in a separate article. For now, you can read more about “srcset” here.

 


 

Step 3) Resize your image to the maximum display size

Use a photo editor (Photoshop, GIMP, etc) and resize the photo dimensions down to the maximum display size.
 

Use an image editor to resize your image to the maximum display size.

 

Export your image for the web, depending on the type of graphic:

  • Photos and colourful, high detail images – Use JPG.
    • Adjust the quality percentage to what you feel is acceptable.
  • Logos and basic graphics with few colours or transparency – Use PNG.
    • PNG is a lossless format, so there are no quality adjustments to make.

 

Important things to note

  • If you want to ensure maximum quality for retina displays, you can opt for 2x the maximum display size dimensions.
    • For example, an image with a 400 x 200 maximum display size, you could resize an image to 800 x 400.
    • This may still trigger the “Serve scaled images” recommendation however, due to GTmetrix’s analysis viewport of 1024×768.

 


 

Step 4) Compress the image

Image editors don’t do the best job of compressing images, so we need to run our images through a compression tool. The best ones we like are:

Image optimizers like Kraken offer services for free!

Upload your uncompressed images with these free-to-use tools and download the resulting optimized versions. You’ll notice a substantial decrease in filesize.

 

From 90.65KB to 38.12KB – 57.95% smaller than the original!

Note: You can also use the optimized images GTmetrix generates when expanding the “Optimize your images” recommendation, however the above tools have far more advanced compression algorithms and can save you even more in filesize.

 


 

Step 5) Replace your unoptimized image with your newly optimized one

The image you optimized is now resized and compressed – be sure use it as is and not apply any CMS-level alterations to it. This might include inserting it at CMS-defined size or cropping it from within your CMS – more on this here.

In WordPress for example, use “Full Size” instead of the pre-generated media sizes.

Replace or reinsert your images at original or full size in order to retain the optimization you did on the image.

Run another GTmetrix analysis on your page and you’ll find that you now score better on “Serve scaled images” and “Optimize your images” recommendations!

Properly scaled and compressed images will disappear from these recommendations.

 


 

Using WordPress? Use Piio!

Piio is a great image optimization solution for WordPress, as it not only compresses your images, it also resizes them, serves them via CDN and adds lazyload!

Best of all, it’s free for up to 1gb of transfer per month – and works great for the majority of WordPress users looking to optimize images. Here’s how to get started:

 

Step 1) Download and Install Piio

Search for “Piio” in the plugins directory.

Search for Piio from your Plugins page, install the plugin and activate it.

 

Step 2) Visit the Piio plugin page

Piio will appear in the left sidebar upon activation.

There will be a new option in the left side bar called “Piio” – click on it to access the Piio plugin page.

 

Step 3) Sign up for a free Piio account

You’ll need a Piio API key for this plugin to work, so visit https://piio.co and signup for a free account.

Visit https://piio.co and sign up for a free account.

 

Once you’re logged in, enter the domain name where your WordPress blog is installed – click Create.

Enter your domain where your WordPress platform installed.

 

You’ll then have an API key generated for your domain name.
 

Your Piio API key will be generated here.

 

Step 4) Configure your Piio plugin

 

Copy your Piio API key and paste it into the “Api Key” field in the Piio WordPress plugin.

Paste your API key into the Piio WordPress plugin.

 

Then, ensure your settings match the below screenshot:

Ensure your settings are as seen above. Click Save Changes when complete.

 

Notes on certain options

  • Optimization
    • The Standard option is best for compatibility, but you may yield better compression results with Advanced beta. We recommend you stick with Standard to ensure nothing conflicts.
       
  • Lazy Loading Mode
    • This enables Lazy Loading of your images, essentially delaying image loading only until you scroll within the viewport. Again, you may yield better performance increases with Strict, but Friendly would be best for compatibility.
       
  • Script Position
    • You can select where to place the Piio plugin scripts in case there are conflicts with other plugins. Leave it on Body End if there are no issues.
       

That’s it! Piio will automatically perform the following on your images:

  • Compression
    • Images will be run through compression to reduce filesize without any visible degradation in quality – improving the Optimize images recommendation.
       
  • Resizing
    • Images will be served in their scaled form, relative to the viewport – improving the Serve scaled images recommendation.
       
  • Served via CDN
  • Applying Lazy Load
    • Images will be lazy loaded, meaning they will only load when within the browser viewport – improving the Fully loaded time, Number of requests and Total page size.
       

 


 

Common problems and questions

 

Q: I optimized images and re-uploaded them in WordPress / Magento / other CMS; why are the images are larger than before?

A: This is due to your CMS regenerating the photo either at a different size or by cropping. When you upload a photo in your CMS, it likely goes through processing to generate different sizes for use as thumbnails or small/medium/large sizes in your content. Even if your original image was optimized, the CMS reads it as any other image, does its processing, and generates a new image without compression.

If you’re using WordPress, a plugin can be used to optimize your Media Library, including the WordPress generated images. We recommend WP Smush, which features automatic optimization of uploaded images, and a bulk optimization feature for existing images.

 

Q:Will optimizing my images decrease the quality of them?

A: If you losslessly compress your images, no. Lossless compression is simply reorganizing your image data into a more compact and efficient form. No image data is lost. Combined with stripping out extraneous unseen metadata, your images will not have any difference in quality, down to the byte.

If you utilize lossy compression, yes. But by using the advanced optimization tools mentioned above, you’ll likely not be able to tell the difference. In its basic form, these tools use advanced algorithms to strip near identical image data such that it is imperceptible from the human eye. Your images will lose data, but you (and your users) cannot tell the difference.

 

Q: I optimized my Media Library images using a plugin; Why am I still not scoring well on the “Optimize your image” recommendation?

A: There are a few things that could be happening:

  • The unoptimized images are from your plugins
    • If you’re using a plugin that displays an image, that image isn’t being served from your Media Library, but rather from your plugin directory.
    • You can either configure your image optimization plugin to optimize images in your plugin directory, or manually optimize them using the above tools.
  • The unoptimized images come from third-party resources
    • Third-party resources are not hosted on your server and therefore cannot be optimized in any way.
    • Best to minimize usage of these images.

 


 

Further reading

We’ve outlined a very general approach to image optimization and its concepts. Below are some more articles on image optimization techniques:

 


Scroll to Top