This guide walks you through the exact steps to get a perfect 100 score on Google PageSpeed Insights and improve your Core Web Vitals. You’ll learn what the tool checks, how to fix the most common performance issues, and what to do when a perfect score seems impossible.
What You’ll Need
- Access to your website’s hosting control panel (cPanel, FTP, or a file manager).
- Ability to edit HTML, CSS, and JavaScript files, or a plugin that lets you do so (like a caching plugin on WordPress).
- A Google account (to use PageSpeed Insights and Search Console).
- Patience – perfect scores often require several rounds of testing and fixing.
Step-by-Step
- Test your current site. Go to Google PageSpeed Insights, enter your URL, and click Analyze. Run both mobile and desktop tests. Note your current score and the list of failed audits.
- Enable text compression (Gzip or Brotli). In your server config (e.g., .htaccess for Apache, nginx.conf for Nginx), enable compression for text files. For Apache, add:
AddOutputFilterByType DEFLATE text/html text/css text/javascript application/javascript. Test with a tool like GIDNetwork’s compression test. - Optimize images. Convert all images to modern formats like WebP (or AVIF if supported). Use tools like Squoosh or ImageOptim. Set explicit width and height attributes on every
<img>tag to prevent layout shift. Consider lazy-loading images below the fold withloading="lazy". - Eliminate render-blocking resources. Inline critical CSS (the CSS needed for above-the-fold content) directly into the HTML
<head>. Load non-critical CSS withmedia="print"and then swap to all after load. Defer JavaScript with thedeferattribute, or load it asynchronously withasync. - Minify CSS, JavaScript, and HTML. Remove all unnecessary characters (spaces, comments, line breaks) from your code. Use a tool like UglifyJS for JavaScript, CleanCSS for CSS, and HtmlMinifier for HTML. Many build tools (Webpack, Gulp) do this automatically.
- Leverage browser caching. Set cache expiration headers for static assets (images, CSS, JS). In .htaccess, add something like:
<FilesMatch "\.(css|js|png|jpg|webp)$"> Header set Cache-Control "max-age=31536000, public" </FilesMatch>. For HTML, use a shorter cache like 3600 seconds. - Preload key requests. Add
<link rel="preload" as="style" href="style.css">for your main CSS and<link rel="preload" as="script" href="script.js">for your main JS. This tells the browser to start downloading them early. - Remove unused CSS and JavaScript. Use Chrome DevTools Coverage tab (Ctrl+Shift+P > Show Coverage) to find code that is never used. Remove it or split it into separate files loaded only when needed.
- Use a Content Delivery Network (CDN). A CDN stores copies of your site’s static files on servers around the world, reducing latency. Popular options include Cloudflare, BunnyCDN, and Fastly. This also helps with TTFB (Time To First Byte).
- Optimize server response time. Aim for a TTFB under 200ms. Upgrade your hosting if needed, use a faster PHP version, enable server-side caching (like Varnish or Redis), and optimize your database queries.
- Fix layout shift (CLS). Reserve space for images, videos, and ads with CSS (e.g.,
aspect-ratioor fixed height). Avoid injecting content above existing content. Usefont-display: swapfor web fonts to prevent invisible text. - Reduce JavaScript execution time. Break up long tasks (over 50ms) into smaller ones using
requestAnimationFrameorsetTimeout. Consider using Web Workers for heavy computations. - Optimize web fonts. Use
font-display: swapin your @font-face rule. Preload the most important font file. Subset your fonts to include only the characters you need. Consider using system fonts if you want to eliminate font loading entirely. - Re-test and iterate. After each change, re-run PageSpeed Insights. Fix the highest-impact issues first. Sometimes fixing one issue reveals another.
Common Mistakes
- Chasing 100 on mobile. Mobile scores are often lower due to hardware limitations. A 95+ on mobile and 100 on desktop is a realistic goal for many sites.
- Ignoring real-world data. PageSpeed Insights also shows “Field Data” from real users. Even if lab tests are perfect, your users may have slow connections. Optimize for the 90th percentile of your users.
- Over-optimizing images. Compressing images too much can make them blurry. Always visually check your images after compression.
- Using too many plugins. On WordPress, each plugin adds CSS and JS. Audit your plugins and remove any that are not essential.
- Not testing on a real device. PageSpeed Insights uses a simulated device. Use Chrome DevTools’ Lighthouse tab to test with your actual device and network throttling.
Tips
- Use the “Opportunities” and “Diagnostics” sections of PageSpeed Insights to get specific, actionable suggestions.
- Set up Search Console’s Core Web Vitals report to monitor your real-world performance over time.
- Implement a service worker to cache your site’s shell for instant repeat loads.
- Use HTTP/2 or HTTP/3 on your server to reduce connection overhead.
- Consider using a static site generator (like Hugo or Jekyll) if your site is mostly content – they are inherently fast.
Troubleshooting
Score doesn’t improve after changes. Clear your browser cache and test again. Sometimes PageSpeed Insights caches results for a few minutes. Also, ensure your changes are actually live (hard refresh your site).
“Eliminate render-blocking resources” persists. You may have inlined critical CSS incorrectly. Use a tool like Critical CSS Generator to extract the exact CSS needed above the fold. Also, check that you haven’t left any <link rel="stylesheet"> in the <head> without a media attribute.
Images still cause layout shift. Even with width/height attributes, if you use CSS to change the size, the browser may not reserve space. Use the aspect-ratio CSS property and ensure your CSS does not override the dimensions.
JavaScript errors. If you defer or async your scripts, they may run in a different order. Test your site thoroughly after making changes. Use the browser’s console to spot errors.
Server response time is slow. If you’re on shared hosting, consider upgrading to a VPS or dedicated server. Enable server-side caching (like LiteSpeed Cache or WP Rocket) to reduce PHP processing.
Frequently Asked Questions
Is a 100 score necessary for Core Web Vitals? No. Core Web Vitals are specific metrics (LCP, CLS, INP) that have thresholds for “good” performance. A 100 score on PageSpeed Insights usually means you pass those thresholds, but you could score 90 and still pass. Focus on the metrics, not the number.
Why does my mobile score differ from desktop? Mobile devices have less CPU, memory, and slower network. PageSpeed Insights simulates a mid-range Android device on a slow 3G connection, so it’s a stricter test.
Can I get 100 with a WordPress site? Yes, but it’s harder. Use a lightweight theme (like GeneratePress or Astra), a caching plugin (like WP Rocket), and optimize your images. Avoid page builders that add heavy CSS/JS.
How long does it take to see improvements? Lab tests (PageSpeed Insights) update immediately. Field data (CrUX) updates every 28 days. So you may see your lab score jump right away, but field data takes a month to reflect changes.
What is the biggest factor in getting 100? Usually, it’s eliminating render-blocking resources and optimizing images. These two issues account for most score deductions on typical sites.
Do I need a CDN to get 100? Not strictly, but it helps significantly with TTFB and LCP, especially for users far from your server. Many CDNs also offer automatic image optimization and caching.
Related
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.
More cards in this drawer
- Unbox ASMR Codes: What They Are & How to Use5.00 min/km
- Repurposed Old Motorola Phone for Homelab?
- How to Evaluate AI Vendors for Data Security, Privacy & Compliance
- Best Ergonomic Mouse: Top Picks & Buying Guide
- Captions in Google Slides: How to Add & Format Them
- Use Mac Type in Japanese? Full Guide