[1 TIP] Improve your loading speed of a wordpress website

Visual Eagle

Elite Member
Joined
Dec 11, 2008
Messages
2,630
Reaction score
2,282
Hello people.

So I've been playing around with my WordPress sites and checking if there is anything I can still improve to my loading speed. I've found out that at least in my case the "site identity icon" which WordPress recommends at 512x512 res. was cropped to 192x192 and 32x32 and loaded two times with even a delay after all the files have loaded.

How you can check if you are affected?

Most probably you are if you are using "site identity icon" via customize on WordPress. Visit the following website and test it out. Check the graph of all the loaded files and see if you have the same thing I have (2 favicons loading).

https://tools.pingdom.com/

Are you affected? If so, proceed with the following...

Before you proceed, I recommend that you resize your icon to something like 128x128 or 64x64 to make the site even smaller. If you want to be on point with favicon size then you can resize it to 16x16 (use photoshop or any other software) to decrease the size of the icon.

Step 1: Convert your favicon into a data-URI. Use the website below to do exactly that.

http://dataurl.net/#dataurlmaker

Step 2: Replace your existing favicon with the following code (use in function.php)

function add_favicon() {
echo '<link rel="shortcut icon" type="image/x-icon" href="data:image/x-icon;base64,visualeagle copy url code here.......=" />';
}

add_action('wp_head', 'add_favicon');

Step 3: Make sure you remove the icon from the customize page so the new data icon will load.

While this probably will break the usage of having an icon on home screen on mobile phones when people bookmark the site to the launcher (if any even do that I know I only bookmark in the browser). It helped me improve my loading speed of about 700MS.
 
Thanks. I'll check it out. Every millisecond is important.
 
Thanks. I'll check it out. Every millisecond is important.

Indeed ;) I think HTML site owners won't have this problem it probably is only specific to WP. Also have to report something to WP Rocket guys :D they have badly optimized images in their plugin for some things like videos...
 
Indeed ;) I think HTML site owners won't have this problem it probably is only specific to WP. Also have to report something to WP Rocket guys :D they have badly optimized images in their plugin for some things like videos...
Step 2 should be done in a child theme, as it's lost next update and you'll have to do it again
 
Thanks. Do you mind sharing with us the site speed before the test?

Just try it yourself if you have this "issue" :) you can always revert back if something goes south (which it wont).
 
Back
Top