In this article, we will continue what we started earlier on how to increase and improve the speed and performance of the WordPress site
We will follow the rest of the steps of the improving speed and performance :
Do not upload audio / video files directly to WordPress
You can upload audio and video files directly to your WordPress site, and it will automatically display them in the HTML5 Player …
But you should never do that!
Audio and video hosting will cost you bandwidth. Your web hosting company may incur excessive fees, or it may shut down your site altogether, even if your plan includes “unlimited”bandwidth.
Hosting large media files also significantly increases the volumes of backups, and makes it difficult for you to restore WordPress from the backup .
Instead, you should use an audio and video hosting service such as YouTube, Vimeo, DailyMotion, SoundCloud, etc., and let them take over the hard work. They have the bandwidth for that!
WordPress has a built-in video embedding feature, so you can copy and paste the URL title of your video directly into your post and it will be automatically embedded.
Find out more details about how it works in our guide on embedding videos in WordPress .
If you are creating a podcast website using WordPress, we recommend the podcast hosting service Blubrry for Best Performance.
Use a speed-optimized theme
When choosing a theme for your website, it is important to pay special attention to improving speed and performance . Some beautiful and impressive themes are actually poorly coded and can slow down your site.
It is usually better to use a simpler theme than to choose a bloated theme with complex layouts, flashy animations and other unnecessary features. You can always add these features using high-quality WordPress plugins.
Premium WordPress template stores such as StudioPress, Themify, CSSIgniter, and Astra offer well-coded, speed-optimized themes.
Use the fastest plugins
Poorly encrypted WordPress plugins often load a lot of bloat whether your site needs them or not. This increases the loading speed of your page and slows down your site.
To help you choose the best plugins, we often publish our expert selection of the best WordPress plugin offers . We pay special attention to ease of use, user experience and most importantly performance.
Here are some of our selections of the most popular WordPress plugin categories.
- WPForms is the fastest and friendliest contact form plugin for WordPress.
- All in SE SEO-a powerful WordPress SEO plugin that focuses more on website performance to help you get better SEO rankings.
- MonsterInsights-the best Google Analytics plugin for WordPress that does not slow down your site. It also includes options for downloading gtag.js locally to speed up the result of Google Core Web Vitals.
- Shared Counts-social media plugins load additional scripts and not safely. Shared Counts is one of the fastest social media components of WordPress.
- SeedProd-drag and drop the WordPress landing page component that helps you create quick landing pages.
Apart from our own recommendations, you can take your own tests. Just do speed tests before and after installing the plugin to compare its effect on performance.
WordPress fine-tuning of speed (advanced)
Using the WordPress optimization best practices and the basic speed tips mentioned above, you should see a significant improvement in your site’s load times.
But every fraction of a second is important. If you want to get the fastest speed possible, you want to make some other changes.
The following tips are more technical , as some of them require editing your site files or getting a basic understanding of PHP . You will need to make sure to back up your site first in case this happens.
Splitting long posts into pages
Readers tend to like longer and more in-depth blog posts. Longer posts tend to rank higher in search engines.
But if you publish long articles with a lot of photos, this can damage the loading times.
Instead, consider splitting your long posts into multiple pages.
WordPress comes with built-in functions to do this. Just add <!–- nextpage–>the tag in your article where you want to split it to the next page. Do this again if you want to split the article to the next page as well.
Reduce external HTTP requests
Many WordPress plugins and themes upload all kinds of files from other websites. These files can include scripts, style sheets, images from external resources such as Google, Facebook, analytics services, etc.
It’s okay to use a few of those. Many of these files are optimized for downloading as quickly as possible, so they are faster than hosting them on your website.
But if your plugins make a lot of such requests, this can significantly slow down your website.
You can reduce all external HTTP requests by disabling scripts and styles or combining them into one file.
Reduce database calls
Note :
This step is more technical and will require basic knowledge of PHP and WordPress template files .
Unfortunately, there are a lot of poorly encrypted WordPress templates. They ignore standard WordPress practices and end up making direct database calls, or a lot of unnecessary database requests. This can really slow down your server by giving it too much work to do.
Even well-coded themes can have code that makes database calls just to get the basic information for your blog.
In this example, every time you see <?php, this is the beginning of a new database call :
1 2 3 4 |
<html xmlns="http://www.w3.org/1999/xhtml" dir="<?php language_attributes(); ?>"> <head profile="http://gmpg.org/xfn/11"> <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?> charset=<?php bloginfo('charset'); ?>" /> |
You can’t blame theme developers for that. They simply have no other way to find out the language of your site.
But if you are customizing your site with a child theme, you can replace these database calls with your specific information to reduce all these database calls.
1 2 3 |
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr"> <head profile="http://gmpg.org/xfn/11"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
Improving the WordPress database
After using WordPress for a while, your database will contain a lot of information that you probably no longer need. To improve performance, you can optimize your database to get rid of all that unnecessary information.
This can be easily managed using the WP-Sweep plugin . It allows you to clean up your WordPress database by deleting things like deleted posts, reviews, unused tags, etc. It will also optimize the structure of your database with one click.
Identify publication reviews
Publishing reviews takes up space in your WordPress database. Some users believe that revisions can also affect some database queries managed by plugins. If the plugin does not specifically exclude post reviews, it can slow down your site by searching through them unnecessarily.
You can easily determine the number of reviews that WordPress maintains for each article. Just add this line of code to the wp-config file.your php.
1 |
define( 'WP_POST_REVISIONS', 4 ); |
This code will limit WordPress to saving only the last four reviews for each post or page, and automatically discard older reviews.
Disable Hotlinking and Leaching for your content
If you are creating high-quality content on your WordPress site, the sad truth is that sooner or later it will probably be stolen.
One way this happens is that other websites submit your photos directly from their URL addresses on your website, instead of uploading them to their own servers. In fact, they are stealing the web hosting bandwidth, and you don’t get any traffic to view.
Just add this code to your htaccess file to prevent quick linking of images from your WordPress site.
1 2 3 4 5 6 |
#disable hotlinking of images with forbidden or custom image option RewriteEngine on RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?dr-wp.com [NC] RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?google.com [NC] RewriteRule \.(jpg|jpeg|png|gif)$ – [NC,F,L] |
Note: do not forget to change dr-wp.com with your own domain.
Some content scraping websites automatically create posts by stealing your content from your RSS feed .
Use Lazy Loading if necessary
If you add many photos, multiple videos, and photo galleries to your blog posts, your site can benefit from slow loading.
Instead of uploading all your photos and videos at once, slow loading downloads only those that will be visible on the user’s screen. Replaces all photos and other video content with a placeholder image.
As the user scrolls down, your website uploads images that are now visible in the browser’s viewing area. You can slow load photos, videos, and even WordPress and gravatars comments.
For photos, iframes and videos, you can use the Lazy Load by WP Rocket plugin.
Use the DNS Level Website Firewall
The WordPress firewall plugin helps you prevent brute force attacks, hacking attempts and malware. However, not all firewall plugins are the same.
Some of them work on your website, this means that attackers are already able to gain access to your web server before they are blocked. This is still effective for security, but not optimal for performance.
That is why we recommend using a DNS-level firewall such as Sucuri or Cloudflare . These firewalls block large requests even before they reach your website.
Fix HTTPS / SSL errors without the plugin
If you are converting your site to HTTPS / SSL, it is likely that you may experience mixed content errors .
The easiest way to fix this is to install a plugin like Really Simple SSL . However, the problem is that these plugins capture all the عناوين addresses first, and then change them to HTTPS before sending them to the user’s browsers.
This has a small but noticeable performance effect. You can reduce this by fixing all the عناوين addresses manually.
Use the latest version of PHP
WordPress is mainly written in the PHP programming language. It is a server-side language, which means that it is installed and running on your hosting server.
All good WordPress hosting companies use the most stable PHP version on their servers. However, it is possible that your hosting company is running a slightly older PHP version.
The latest PHP 7 is twice as fast as its predecessors. This is a huge performance boost that your website should benefit from.
You can find out which PHP version your site is using by installing and activating the version information Plugin .
Upon activation, the plugin will display your PHP version in the footer area of the WordPress admin control panel.
If your website uses a lower version of PHP 7, Ask the hosting provider to update it for you. If they can’t do this, then it’s time to find a new WordPress hosting company .
That’s it! We hope this article helped you learn how to improve the speed and performance of WordPress.
Go ahead and try these techniques. Don’t forget to test the speed of your website before and after implementing best practices.
You will be surprised that these changes will enhance the speed and performance of your WordPress.
You may also want to check out The Ultimate WordPress SEO Guide to improve SEO rankings .