Optimize images using using WP-CLI

While working on my sister’s site https://alinelange.de/ I noticed that every image was available in 10 different formats caused by 19 different images size definitions.

I do have to say that my sister is a professional photographer who keeps blogging regularly since 2012. Throughout the years she uploaded 6000+ images. Due to the various images sizes the upload folder of her site used 10 GB storage.

To save storage, I’ve analyzed which of the defined images sizes are actually used and which one can be replaced and removed. In the first step, I set the height and width of the obsolete images to zero pixels by adding the following snippet to my functions.php:

In the next step, I deleted the obsolete images sizes one by one using the following WP-CLI calls:

While I could have skipped this step, I wanted to work on one image size at a time to be able to measure the impact of the change. After the first round of optimization the images sizes looked like this:

After checking the site to verify that no images are missing I then removed all obsolete image definitions by replacing the previous snippet with the following one:

After the second round of optimization the images sizes looked like this:

In a final step, I regenerated all images by running the following WP-CLI statement:

While it’s not much, I was able to save 300 MB of space on the server. I assume that while I’ve deleted many images, I might have also created a few variations of images that haven’t existed yet. This is the final result.

WordPress 5.1 RC2

Earlier today, WordPress 5.1 RC2 had been released. You can either test it by using the WordPress Beta Tester plugin or by downloading the source code.

According to the schedule, WordPress 5.1 should be released on Thursday, February 21. Until then, plugin developers are encouraged to test their plugins against WordPress 5.1. In addition, contributors are encouraged to translate the upcoming release.

WordPress 5.1 RC2


A while ago, a good friend infected me with the Rubik’s Cube virus. I went ahead and got myself a 2×2, a 3×3 and a 4×4 cube to begin with. A few days ago, I extended my collection by a 5×5 and a 6×6. I absolutely love playing with the Rubik’s Cubes.

And as I’ve looked up various videos on YouTube on how to solve the cube, I just stumbled upon a fantastic Dutch animation named Scrambled:

Don’t worry, no one talks in the video, thus, even if you don’t speak Dutch, you’ll enjoy the animation.

No patchwork today?

Nah … not today. I kept myself busy with engineering happiness for Automattic as well as having a great meeting with my good friend and best man Mark from Gunung An and The Onion Collective about his websites. I do have to admit that I’m a big fan of the Genesis Framework and as Mark’s thinking about redesigning the existing pages, I suggesting using the Genesis Framework.