Speeding up a WordPress site comes down to limiting three sources of slowness: the PHP code run on every visit, the requests sent to the database and the weight of the files the browser downloads (images, CSS, JavaScript).
The nine tweaks below go from the simplest to the least simple, and none requires changing hosts. I have sorted them by difficulty: a modest blog already gains a lot from the first three.
As a reminder, what slows down the loading of a WordPress site boils down to three items:
- the execution of the PHP commands of the theme and plugins;
- reading information from the database;
- downloading the images, stylesheets, JavaScript and other elements of the page.
Before any tweak: measure with the Core Web Vitals
A tweak is only worth keeping if it shows up in the figures, so note the starting point first. Google groups page experience into three Core Web Vitals, and its developer site web.dev sets the bar for a good result:
| Metric | What it measures | Good result |
|---|---|---|
| LCP (Largest Contentful Paint) | Time until the main block of the page is displayed | 2.5 seconds or less |
| INP (Interaction to Next Paint) | Delay before the page reacts to a click or a tap | 200 milliseconds or less |
| CLS (Cumulative Layout Shift) | How much the layout jumps while loading | 0.1 or less |
Google does not judge a single visit: web.dev recommends reading these values at the 75th percentile of page loads, separately on mobile and desktop. In practice, PageSpeed Insights shows both the field data collected from Chrome users and a lab test; run it on the home page and on a typical post, before and after each change, and change one thing at a time so that you know which tweak helped.
1. Remove unnecessary plugins
A slow WordPress site often hides a list of plugins that is too long. If the answer is more than 10, go through them one by one: those that are no longer useful can be deactivated and then deleted, and those that only add a few lines can be replaced by a small piece of code in the child theme.
The rule remains the same as on day one: a plugin is only installed if it meets a real need, and simple code is better than a full plugin for a single function. The number matters less than the weight: a single plugin that loads its scripts on every page, even where it is not used, costs more than several light ones. Deactivate suspects one at a time and rerun the measurement to find it.
2. Eliminate unnecessary PHP tags
On a classic theme that you did not write yourself, the header file often calls PHP functions to display information that never changes. For example, your header might contain:
With PHP:
<title><?php bloginfo('description'); ?> - <?php bloginfo('name'); ?></title>
Without PHP:
<title>Best WordPress Blog - My blog</title>
These replacements only apply to a classic theme modified in a child theme: on a block theme or a theme updated by its publisher, the change would be overwritten at the next update. Here are the calls that can be hard-coded:
- <?php language_attributes(); ?> (in header.php) by the site's language;
- <?php bloginfo('template_directory'); ?> and <?php bloginfo('stylesheet_directory'); ?> (almost everywhere in the theme) by /wp-content/themes/_theme_name_/;
- <?php bloginfo('name'); ?> (almost everywhere in the theme) by your blog's name;
- <?php bloginfo('rss2_url'); ?> and <?php bloginfo('comments_rss2_url'); ?> (in header.php, sidebar.php and footer.php) by the address of your RSS feeds, hard-coded;
- the comment <!-- <?php echo get_num_queries(); ?> queries. <?php timer_stop(1); ?> seconds. --> (in footer.php), which only serves the developer and can go.
Following David's good advice, the menu can also be rebuilt entirely, with hard-coded links in place of variables. Once a page cache is active (next tweak), these calls only run when the cache is rebuilt, so this step matters most on a site that cannot use a cache.
3. Install a caching plugin such as WP Super Cache
Page caching remains the most effective technique for speeding up WordPress. The WP Super Cache plugin generates static HTML pages, which are then served to every visitor without running PHP code or querying the database. Once configured, it fades into the background; just remember to clear the cache when you change your theme. Some hosts already provide a server-side page cache: check their documentation first, because two page caches stacked on top of each other bring nothing and complicate the clearing. Other plugins complement this work on SEO, as shown by the selection of agencies' favorite SEO plugins.
4. Optimize the database
An optimized WordPress database reduces loading time and server load, especially when it has grown over the years. Two methods exist: by hand or with a cleanup plugin.
The manual method goes through phpMyAdmin, accessible from your host's panel: select the database, tick all the tables with "check all" at the bottom of the page, then choose "Optimize table" in the dropdown menu. A full backup always comes before the operation.
5. Lighten the images
Images that are too heavy weigh on both the blog's bandwidth and display time. In Photoshop or any other editing software, the "save for web" command in the File menu, or a more compressed JPEG, is often enough.
As a reference, I prefer images of 40 KB or less, without sacrificing quality.
Yahoo!'s online service Smush.it has disappeared; its name lives on in the Smush plugin, published by WPMU DEV in the official WordPress directory, which compresses images when they are uploaded and can process those already in the media library. Each image's alt text also matters to Google, as explained in the method for optimizing images and their alt attribute.
Deferred loading no longer needs a plugin: since WordPress 5.5, the core adds the loading="lazy" attribute to images that carry a width and a height, so the images lower down the page only download when the reader scrolls towards them. Two cautions follow from this. Keep the width and height of each image, which also prevents the layout from jumping (the CLS above). And check that an old lazy-loading plugin is not doing the same job a second time.
Another point raised in the comments by lokk: limiting the automatic creation of thumbnails avoids storing each image in several copies. The setting is in the WordPress admin, under Settings then Media, where unneeded sizes are set to 0.
6. Compress CSS and JavaScript
Compressing stylesheets and scripts removes the spaces, line breaks and comments that the browser does not use. Many caching plugins offer this minification in their settings; otherwise, a dedicated plugin takes care of it.
JavaScript also benefits from being combined and loaded at the bottom of the page (in the footer.php file on a classic theme) or deferred: the text displays first, the scripts arrive afterwards. Test the site after each change, because a script loaded too late can break a menu or a form. Heavy scripts are also the usual cause of a poor INP, since the page cannot respond to a click while they run.
7. Block hotlinking
Hotlinking is when another site displays your images by pointing directly to their address: your server pays for the bandwidth.
On an Apache server, the .htaccess file placed at the root can block it. Back up this file first, then add the lines below, replacing the domain with yours. Empty referrers stay allowed, so direct visits and feed readers still see the images.
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^https?://(www\.)?exemple\.com/ [NC]
RewriteRule \.(gif|jpe?g|png|webp)$ - [F,NC]
The [F] flag returns a refusal and stops the processing there, so a redirect line placed after it never runs. To display a replacement image instead of a refusal, use the redirect in place of the refusal, and exclude the replacement file from the rule, otherwise it is itself blocked and the browser loops. Also add the domains that must keep access, such as a CDN or a search engine's image service, with one extra RewriteCond line each.
8. Limit post revisions
Post revisions are of little use on a blog run by a single author, and they pile up in the database. To disable them, add the following line to the wp-config.php file, typed with straight quotes, because the curly quotes some editors insert make PHP fail:
define('WP_POST_REVISIONS', false);
Replacing false with a small number, for example define('WP_POST_REVISIONS', 3);, keeps only the latest versions of each post, which keeps a safety net. Existing revisions are deleted with this query in phpMyAdmin:
DELETE a,b,c FROM wp_posts a LEFT JOIN wp_term_relationships b ON (a.ID = b.object_id) LEFT JOIN wp_postmeta c ON (a.ID = c.post_id) WHERE a.post_type = 'revision'
Always make a copy of your database before running a query in phpMyAdmin, and check your table prefix, which is not necessarily wp_. If your host provides WP-CLI, the same cleanup runs without writing SQL: wp post delete $(wp post list --post_type=revision --format=ids) --force.
9. Avoid resource-hungry statistics plugins
Statistics plugins that record every visit in the WordPress database weigh down every page view. An external measurement tool, such as Google Analytics, does not use your database and does not slow down the server.
When the nine tweaks are not enough: PHP version and hosting
One setting is often forgotten because it sits in the host's panel rather than in WordPress: the PHP version. WordPress.org currently recommends PHP 8.3 or greater, and an old branch runs the same code more slowly while no longer receiving security fixes. Check the version under Tools then Site Health, test the change on a copy of the site if your plugins are old, then switch.
When all these tweaks are done and the site is still slow, the limit often comes from the hosting itself: the question of a dedicated server for WordPress then arises.
Quick answers on WordPress loading speed
Which tweak should come first on a small blog? The page cache: it removes the PHP execution and the database queries for most visits at once, before any finer work on the theme.
Why is the mobile score lower than the desktop one? PageSpeed Insights tests mobile with a slower simulated connection and processor, so heavy images and scripts weigh more there; the Core Web Vitals are read separately for each type of device.
Can a tweak make the site slower? Yes: two caching or lazy-loading plugins doing the same job, or scripts combined in the wrong order, can cancel the gain or break a page. Measure after every change and undo the last one if the figures get worse.
One last handy tool for spotting the elements that slow you down: Pingdom Tools, which details the loading time of each file on the page.




