Improve WordPress Speed with These Simple Tweaks
Site speed is not just about user experience — it's also a major ranking factor in Google’s algorithm. If your WordPress site feels sluggish, don’t rush to install another performance plugin. You can achieve fast, smooth performance with just a few clean, developer-friendly tweaks — no extra bloat required.
1. Disable Unused WordPress Features (Like XML-RPC and Emojis)
WordPress loads many features by default that most sites don’t need — like XML-RPC
, emoji scripts, and oEmbed. Disabling them reduces HTTP requests and cleans up your HTML output.
// Disable XML-RPC
add_filter('xmlrpc_enabled', '__return_false');
// Remove emoji scripts
remove_action('wp_head', 'print_emoji_detection_script', 7);
remove_action('wp_print_styles', 'print_emoji_styles');
2. Host Google Fonts Locally
External font requests can slow down page load, especially from Google Fonts. Instead, download the fonts and serve them from your server. This also improves GDPR compliance.
Steps:
- Go to google-webfonts-helper
- Select your font and weights
- Download the font files and copy the generated CSS
- Put fonts in your theme’s
/fonts/
folder - Link them via
wp_enqueue_style()
3. Use Native Lazy Loading for Images
Native lazy loading is supported by all major browsers. Just add loading="lazy"
to your image tags:
<img src="image.jpg" loading="lazy" alt="..." />
If your theme doesn’t do this automatically, you can add it dynamically:
// Add lazy loading to images in content
add_filter('the_content', function($content) {
return preg_replace('/<img(.*?)src=/', '<img loading="lazy"$1src=', $content);
});
4. Defer JavaScript for Better Performance
Defer non-critical JavaScript so the browser can prioritize HTML and CSS rendering. Use this filter in functions.php
to apply defer on enqueued scripts:
add_filter('script_loader_tag', function($tag, $handle) {
if (!is_admin() && !in_array($handle, ['jquery'])) {
return str_replace(' src', ' defer src', $tag);
}
return $tag;
}, 10, 2);
5. Minify CSS & JS Manually Using Gulp or Webpack
Instead of relying on minification plugins, use build tools to compress and concatenate your files during development.
Gulp Example:
// gulpfile.js
const gulp = require('gulp');
const cleanCSS = require('gulp-clean-css');
const uglify = require('gulp-uglify');
const concat = require('gulp-concat');
// Minify CSS
gulp.task('css', function () {
return gulp.src('src/css/*.css')
.pipe(concat('style.min.css'))
.pipe(cleanCSS())
.pipe(gulp.dest('dist/css'));
});
// Minify JS
gulp.task('js', function () {
return gulp.src('src/js/*.js')
.pipe(concat('scripts.min.js'))
.pipe(uglify())
.pipe(gulp.dest('dist/js'));
});
This gives you full control over what gets optimized — and removes the dependency on plugins like Autoptimize or WP Rocket.
Why These Tweaks Matter
Performance plugins are great for non-technical users, but they often add unnecessary scripts and are hard to debug. These manual techniques ensure you know exactly what runs on your site.
Bottom Line: With just a few lines of code and basic build tools, you can dramatically improve your WordPress speed, reduce load times, and give users (and Google) a much better experience — all without any extra plugins.