5 Tricks You Should Be Using to Increase Media Loading Speeds
You go through a lot of trouble to design a beautiful WordPress site that’s chock full of images, videos, animations, and other eye-catching visual content. But what happens when your media files don’t load properly or fast enough? Will the quality of those visuals be enough to compel visitors to wait for them to fully load?
In order to keep your site running in tip-top condition and your media loading as quickly as possible, here are some quick WordPress performance tricks you might not be using now, but definitely should going forward.
5 WordPress Performance Tricks to Increase Media Loading Speeds
- Look, there’s absolutely no secret about what needs to be done to improve performance of a WordPress site.
- Test the speed of your WordPress site as it stands now.
- Use a performance assessment tool like WP Checkup to dig around for problematic areas.
Apply those speed enhancements to your WordPress site.
- Put a performance plugin like Hummingbird in place to decrease the likelihood of these issues cropping up again.
WordPress performance maintenance shouldn’t end there though. This is something you can always be working on improving, especially if you really want to wow visitors with visual content on your site.
Here are some tricks you can use to enhance media loading speeds on your WordPress site:
1. Insert Images at the Proper Size
When you upload an image to a WordPress site, you’re given a choice about how you want to size it:
As you can see in the above example, the original file I uploaded to WordPress is big. We’re talking 3000 x 2000 pixels, which seems unnecessary for what I plan to use it for (to add context to a blog post). While WordPress does give me options to resize the image on the page, it does nothing to change the actual bulk of the file sitting in my Media library. And that’s a problem.
The first way in which you should be working on lightening up your Media folder is by uploading your content at a proper size. There are a few things you can do for this:
Use WordPress’s Sizing Guidelines
The WordPress Codex Image Size and Quality guide is one you should have bookmarked. It provides recommendations on how to keep your WordPress media lean and mean by paying attention to the following:
- File Type: You can upload images in the form of PNG, JPG, SVG, GIF, WebP, and EPS. JPG and SVG are the most lightweight and cross-browser compatible though.
- File Size: WordPress’s maximum upload size is 64 MB. This guide, however, suggests that smaller images should be under 30 KB while larger images can be between 60 and 100 KB.
- Physical Size: This refers to how much space an image occupies on a page. If you can cut the image down to that size before uploading, that would be ideal.
- Resolution: This pertains more to the quality of the image rather than the size. Of course, the higher the resolution (i.e. more pixels per square inch), the larger the file, so be careful of this.
Resize Images Offsite
Once you know what to be mindful of in terms of image size, I would recommend you resize all media files accordingly before they ever get into WordPress.
There are a number of tools you can use to do this:
Image editing software like Photoshop:
Image resizing software like TinyPNG:
If you’re using stock photography, you can also export your newly acquired photos at a more appropriate size:
These tools do things like scale down the dimensions, apply lossy or lossless compression to the file, and remove unnecessary EXIF metadata.
WordPress automatically generates a number of duplicates of your images upon upload (that’s why you see different sizes offered when you embed a new image). You might not see them stored in the Media library, but they are there.
If you are taking the time to resize images before they are uploaded to WordPress, then you should ditch the unnecessary duplicates while you’re at it. Here is how to do it:
Go to the Settings menu and select Media.
Zero out the fields for the sizes you don’t want created. Then set a maximum limit for the remaining size.
Add Image Compression
Resizing media isn’t the only thing you can do to make your library lighter. You can also use image compression to shrink those file uploads down further.
Like the resizing tool I mentioned above, there are a number of image compression tools available online that can handle this. However, you really need to know the difference between lossy and lossless compression as well as what kind of DPI will be acceptable for the resulting resolution if you want to do it right.
If you don’t want to think about it and you want to let an expert take care of it for you, then install the WP Smush Pro plugin on your WordPress site. It will, first, bulk compress all images that are currently there. Then, it will automatically compress each new file uploaded to WordPress.
2. Clean Out Unused Files
Even with optimized and properly sized images sitting in your Media library, you may be creating an unnecessary drag on loading times if you don’t clean up a bit. You wouldn’t believe what a little “spring” cleaning will do to keep your WordPress site’s size manageable, in general.
1.6 million WordPress Superheroes read and trust our blog. Join them and get daily posts delivered to your inbox - free!
These are the areas you should target for cleanup:
Your old, outdated, and unusable media:
Your unused plugins:
Your inactive themes:
Unpublishable pages and posts:
Users that should no longer have access to WordPress or whose accounts have been inactive for a long time:
Be sure to not only delete spam (or otherwise inappropriate comments), but to also empty the trash:
The more files you can get rid of, the better.
3. Make Use of Symlinks
There are two kinds of links you can use to pull data into a system. A hard link is one which points directly to the source; in essence, the hard link becomes a duplicate of the original file. A soft link (or symbolic link) instead points indirectly to a source file or directory through another file.
Why does this difference matter? Well, you can use symbolic links (or symlinks, for short) to store WordPress plugins and themes outside your server. As you know, slow plugins and themes can do pretty terrible things to your site’s performance, which is why it would be incredibly beneficial if you could call on them from somewhere other than your server.
To do this, you will first need a place to store your plugin and theme files. One of the places you might want to store them is in a Git repository. Another is in a cloud storage folder.
Once your files are safely moved to their new home, you can add symlinks to the wp-content folders where your site is trying to call on your theme and plugins. Within each respective folder, you will insert a symlink that points to the new location of your resources. This article from Kinsta quickly explains how to do this.
By relieving your server of these files altogether, you’ll give your media files a fighting chance to perform as well as they need to on the frontend.
4. Optimize Server Settings
There are certain limitations you can set on your web server in order to ensure that media uploads don’t overwhelm your resources and keep images from loading quickly. Specifically, let’s look at how memory limits can be adjusted to keep uploads to a reasonable limit (especially if you’re handing the site off to an overzealous client).
There are three files in which you can revise the PHP memory limits for your site:
If the files don’t exist, you can create them from scratch using a plain text editor and then upload them to the server. (You should have the .htaccess and wp-config; php.ini may need to be created though.)
If the files exist, look for a line that refers to the memory limit. It will look something like this:
If you’re having a hard time finding it, search for “memory_limit”. If it doesn’t exist, here is how you can build it into each file:
memory_limit = 32M
php_value memory_limit 32M
5. Restrict User Access
By now, you already know that you can’t let clients and other restricted-access users run loose in WordPress. It’s not like every user will (un)intentionally break their site, but that still doesn’t mean they should be free to do whatever they want–and that includes uploading a bunch of files, plugins, and themes, or weighing down the server unnecessarily.
Here are some ways in which you can keep media speeds going strong despite their best efforts to undo it all:
Restrict Media Library Access
By default, whenever you create a new user in WordPress–be it a client, one of your team members, a subscriber, or a contributor–they are given access to the media library. If you want the admin to be the only person who controls what media is uploaded to the library, then you can use a plugin like Adminimize to set those rules.
If you want to establish these types of limitations on your membership site, the Membership 2 Pro plugin from WPMU DEV does something similar.
Restrict Plugin and Theme Access
That Adminimize plugin also enables you to put restrictions on who can install new plugins and themes on your WordPress site.
Limit Post Revisions
One more way you may want to keep users from adding too much “content” to the site is by limiting the number of post revisions stored in WordPress. The Revision Control plugin gives you both automated and manual control over revisions so you can ensure that, no matter how many times someone resaves a post or page, the server won’t be bogged down by the excess revisions they don’t need.
You know there’s a lot that can be done in order to keep performance running high on a WordPress site. That said, if media plays a major role on your site and you find that loading speeds are really lagging, take a look at the five areas noted above. You may find that some slight adjustments to settings, access, and the overall upload process will significantly improve its speed.