A collection of PHP snippets to optimize WordPress performance by improving page load times, reducing database overhead, and cleaning up unused resources. Perfect for developers or site owners looking to boost Core Web Vitals and SEO.
- ➡️ Disable emojis and embeds to reduce unnecessary HTTP requests
- ➡️ Remove query strings from static resources
- ➡️ Enable GZIP compression and browser caching
- ➡️ Clean up WordPress head tags (RSD, WLW, etc.)
- ➡️ Lazy-load images for better LCP scores
- ➡️ Optimize database by deleting post revisions and transients
- WordPress
- PHP
- Place
wp-speed-optimization.phpinto your theme’sfunctions.phpfile or convert it into a small custom plugin. - Refresh your site and test with Google PageSpeed Insights or GTmetrix.