SlideShare une entreprise Scribd logo
1  sur  20
Télécharger pour lire hors ligne
Optimizing
Core Web
Vitals.
Make Visitors and Search Engine Happy
• What
• Steps
• Examples
Talking Points:
What
A set of metrics created by Google
to ensure every visitor gets a
positive user experience.
Core Web Vitals
measures the initial loading
performance of the page
measures how long it takes for
visitors to interact with the page
measures the amount of page
layout shifts
What Matters Most ➟
Above
the Fold
Area
source: web.dev
Steps
Basic Principles ➟
Reduce
and
Simplify
request, size, structure
1. Inline Critical CSS
<style id="inlined-critical-css-example">
html, body {
max-width: 100vw;
overflow-x: hidden;
background-color: #171717;
font-weight: 400;
font-size: max(16.5px,min(17px,(100vw - 100vmin)))
}
html {
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
box-sizing: border-box;
}
:root, html, body, button, input, select, textarea {
font-family: thinkweb,Tahoma,Geneva,sans-serif;
}
...
</style>
Can be created
• Using online tools:
1. https://www.sitelocity.com/critical-
path-css-generator
2. https://pegasaas.com/critical-path-
css-generator/
• Manually
Example:
2. Check the Loaded Assets
Tools
• Gtmetrix’s Waterfal Tab
• Chrome Dev Tools
Example:
3. Identify Unused Assets
Tools
• Chrome Dev Tools > Show
Coverage
Example:
4. Handling Unused CSS
Tools
• Remove:
1. Manually
2. Plugins
• Purify:
1. https://purifycss.online/
2. https://uncss-online.com/
• Remove
• Purify
5. Handling Unused JavaScript
Tools
• Remove:
1. Manually
2. Plugins
• Delay:
1. Flying Script (free) *WordPress
2. WP-Rocket (paid) *WordPress
• Remove
• Delay
How to remove assets in WordPress
/* to remove assets on every page */
function tw_unload_files() {
wp_dequeue_style ( 'optim-style' ); // *_style is for css
wp_dequeue_script ( 'jquery-core' ); // *_script is for JavaScript
}
add_action( 'wp_enqueue_scripts', 'tw_unload_files', 100 );
/* to remove assets on certain page or post-type */
function tw_unload_files() {
if ( is_front_page() || is_page([page-id]) || is_single() || is_product() ) {
wp_dequeue_style ( 'optim-style' );
wp_dequeue_script ( 'jquery-core' );
}
}
add_action( 'wp_enqueue_scripts', 'tw_unload_files', 100 );
6. Handling Images
Tools
• Compress:
1. Online Tools
2. Offline Tools
• Delay:
1. Native Lazy Loading
2. JavaScript based
• Image Dedicated CDN:
Imagekit, Statically, AnyoneCDN, etc
• Compress, Reduce, and Resize
• Preload Critical Image
• Delay Below the Fold Images
• Use Image Dedicated CDN
7. Handling Fonts
Basic Principles:
• Limit the number of text fonts
• Don’t use icon fonts
Best Practices:
• Self-host the font files
• Purified and Inline the CSS
• Preload critical font files
8. Handling Above the Fold Area
1. Make it simple
a. Avoid using JavaScript driven content
b. Simplify the HTML structure
c. Limit the number of images
2. Make it fast & light
a. Establish early connections of critical 3rd party resource
b. Don’t combine CSS & JavaScript files
c. Preload any critical assets
d. Delay any non critical assets
e. Use full HTML page cache
q How to Establish Early 3rd Party Connection
/* to pre-connect to the google fonts server */
<link rel="preconnect" href="//fonts.gstatic.com">
/* to prefetch the dns of google fonts */
<link rel="dns-prefetch" href="//fonts.gstatic.com">
Example:
<link rel="preconnect" href="the-asset-source-domain-name">
<link rel="dns-prefetch" href="the-asset-source-domain-name">
q How to Preload Files
/* to preload image */
<link rel="preload" as="image" href="/wp-content/uploads/optimize-core-web-vitals-s.jpg">
/* to preload font */
<link rel="preload" as="font"
href="https://fonts.gstatic.com/s/roboto/v20/KFOmCnqEu92Fr1Mu4mxKKTU1Kg.woff2" crossorigin>
/* to preload JavaScript */
<link rel="preload" as="script" href="/wp-content/themes/generatepress/assets/js/main.min.js">
/* to preload CSS */
<link rel="preload" as="style" href="/wp-content/themes/generatepress/assets/css/main.min.css">
Example:
<link rel="preload" as="the-asset-type" href="the-asset-url-path">
Example / Case Study
www.dewatalks.com
Thank You !

Contenu connexe

Tendances

Website Redesign Presentation
Website Redesign PresentationWebsite Redesign Presentation
Website Redesign Presentation
joanat
 

Tendances (20)

Technical SEO.pdf
Technical SEO.pdfTechnical SEO.pdf
Technical SEO.pdf
 
Javascript & SEO introduction
Javascript & SEO introductionJavascript & SEO introduction
Javascript & SEO introduction
 
Core Web Vitals and SEO: Don't Panic. Improve.
Core Web Vitals and SEO: Don't Panic. Improve.Core Web Vitals and SEO: Don't Panic. Improve.
Core Web Vitals and SEO: Don't Panic. Improve.
 
An introduction to Search Engine Optimization (SEO) and web analytics on fao.org
An introduction to Search Engine Optimization (SEO) and web analytics on fao.orgAn introduction to Search Engine Optimization (SEO) and web analytics on fao.org
An introduction to Search Engine Optimization (SEO) and web analytics on fao.org
 
Web Page Speed - A Most Important Feature
Web Page Speed - A Most Important FeatureWeb Page Speed - A Most Important Feature
Web Page Speed - A Most Important Feature
 
Core Web Vitals and Your Search Rankings
Core Web Vitals and Your Search Rankings Core Web Vitals and Your Search Rankings
Core Web Vitals and Your Search Rankings
 
On-Page Optimization SEO Report Sample by SEO Traffic
On-Page Optimization SEO Report Sample by SEO TrafficOn-Page Optimization SEO Report Sample by SEO Traffic
On-Page Optimization SEO Report Sample by SEO Traffic
 
Technical SEO Audit
Technical SEO AuditTechnical SEO Audit
Technical SEO Audit
 
SEO Presentation
SEO PresentationSEO Presentation
SEO Presentation
 
Le SEO JavaScript démystifié
Le SEO JavaScript démystifiéLe SEO JavaScript démystifié
Le SEO JavaScript démystifié
 
Web Performance: 3 Stages to Success
Web Performance: 3 Stages to SuccessWeb Performance: 3 Stages to Success
Web Performance: 3 Stages to Success
 
Website Redesign Presentation
Website Redesign PresentationWebsite Redesign Presentation
Website Redesign Presentation
 
On page off-page seo points
On page off-page seo pointsOn page off-page seo points
On page off-page seo points
 
Seo ppt - BEGINNERS COURSE - COMPLETE GUIDE - ARISE ROBY
Seo ppt - BEGINNERS COURSE - COMPLETE GUIDE - ARISE ROBYSeo ppt - BEGINNERS COURSE - COMPLETE GUIDE - ARISE ROBY
Seo ppt - BEGINNERS COURSE - COMPLETE GUIDE - ARISE ROBY
 
On-Site SEO Audit Example
On-Site SEO Audit ExampleOn-Site SEO Audit Example
On-Site SEO Audit Example
 
Website Analysis Report : SEO, CRO Website Audit.
Website Analysis Report : SEO, CRO Website Audit.Website Analysis Report : SEO, CRO Website Audit.
Website Analysis Report : SEO, CRO Website Audit.
 
Seo checklist
Seo checklistSeo checklist
Seo checklist
 
Google Search Console
Google Search ConsoleGoogle Search Console
Google Search Console
 
SEO Audit Example & Website Review
SEO Audit Example & Website ReviewSEO Audit Example & Website Review
SEO Audit Example & Website Review
 
Real-World Performance Budgets [PerfNow 2022]
Real-World Performance Budgets [PerfNow 2022]Real-World Performance Budgets [PerfNow 2022]
Real-World Performance Budgets [PerfNow 2022]
 

Similaire à Core Web Vitals Optimization for any website, especially WordPress

Similaire à Core Web Vitals Optimization for any website, especially WordPress (20)

performance.ppt
performance.pptperformance.ppt
performance.ppt
 
Minimize website page loading time – 20+ advanced SEO tips
Minimize website page loading time – 20+ advanced SEO tipsMinimize website page loading time – 20+ advanced SEO tips
Minimize website page loading time – 20+ advanced SEO tips
 
Practical tipsmakemobilefaster oscon2016
Practical tipsmakemobilefaster oscon2016Practical tipsmakemobilefaster oscon2016
Practical tipsmakemobilefaster oscon2016
 
Client Side Optimization
Client Side OptimizationClient Side Optimization
Client Side Optimization
 
Lazy load Website Assets
Lazy load Website AssetsLazy load Website Assets
Lazy load Website Assets
 
High Performance Ajax Applications
High Performance Ajax ApplicationsHigh Performance Ajax Applications
High Performance Ajax Applications
 
Ui dev@naukri-2011
Ui dev@naukri-2011Ui dev@naukri-2011
Ui dev@naukri-2011
 
Optimizing Your WordPress Site: Why speed matters, and how to get there
Optimizing Your WordPress Site: Why speed matters, and how to get thereOptimizing Your WordPress Site: Why speed matters, and how to get there
Optimizing Your WordPress Site: Why speed matters, and how to get there
 
The Need for Speed - SMX Sydney 2013
The Need for Speed - SMX Sydney 2013The Need for Speed - SMX Sydney 2013
The Need for Speed - SMX Sydney 2013
 
Web Components at Scale, HTML5DevConf 2014-10-21
Web Components at Scale, HTML5DevConf 2014-10-21Web Components at Scale, HTML5DevConf 2014-10-21
Web Components at Scale, HTML5DevConf 2014-10-21
 
Presentation Tier optimizations
Presentation Tier optimizationsPresentation Tier optimizations
Presentation Tier optimizations
 
Building high performing web pages
Building high performing web pagesBuilding high performing web pages
Building high performing web pages
 
Progressive Downloads and Rendering
Progressive Downloads and RenderingProgressive Downloads and Rendering
Progressive Downloads and Rendering
 
12 GoMeasure (sg and kl) - page speed light speed path to conversions - joh...
12   GoMeasure (sg and kl) - page speed light speed path to conversions - joh...12   GoMeasure (sg and kl) - page speed light speed path to conversions - joh...
12 GoMeasure (sg and kl) - page speed light speed path to conversions - joh...
 
Automated perf optimization - jQuery Conference
Automated perf optimization - jQuery ConferenceAutomated perf optimization - jQuery Conference
Automated perf optimization - jQuery Conference
 
Developing High Performance Web Apps - CodeMash 2011
Developing High Performance Web Apps - CodeMash 2011Developing High Performance Web Apps - CodeMash 2011
Developing High Performance Web Apps - CodeMash 2011
 
Speed!
Speed!Speed!
Speed!
 
Curtin University Frontend Web Development
Curtin University Frontend Web DevelopmentCurtin University Frontend Web Development
Curtin University Frontend Web Development
 
Responsive Web Design: Clever Tips and Techniques
Responsive Web Design: Clever Tips and TechniquesResponsive Web Design: Clever Tips and Techniques
Responsive Web Design: Clever Tips and Techniques
 
Design for performance
Design for performanceDesign for performance
Design for performance
 

Plus de ClementYo

Plus de ClementYo (9)

Sharing Prompt AI yang Efektif Dalam Pembuatan Konten
Sharing Prompt AI yang Efektif Dalam Pembuatan KontenSharing Prompt AI yang Efektif Dalam Pembuatan Konten
Sharing Prompt AI yang Efektif Dalam Pembuatan Konten
 
Prinsip Dasar Desain Website
Prinsip Dasar Desain WebsitePrinsip Dasar Desain Website
Prinsip Dasar Desain Website
 
Site Structure - Present.pdf
Site Structure - Present.pdfSite Structure - Present.pdf
Site Structure - Present.pdf
 
Whatsapp 101 on WordPress
Whatsapp 101 on WordPressWhatsapp 101 on WordPress
Whatsapp 101 on WordPress
 
Best Practice Elementor Optimization For WordPress.pptx
Best Practice Elementor Optimization For WordPress.pptxBest Practice Elementor Optimization For WordPress.pptx
Best Practice Elementor Optimization For WordPress.pptx
 
Business Mindset: Agency vs Freelancer
Business Mindset: Agency vs FreelancerBusiness Mindset: Agency vs Freelancer
Business Mindset: Agency vs Freelancer
 
How To Create A High Converting Landing Page + Case Studies
How To Create A High Converting Landing Page + Case StudiesHow To Create A High Converting Landing Page + Case Studies
How To Create A High Converting Landing Page + Case Studies
 
SEO Copywriting - A presentation by Andi Datin Hardyanti
SEO Copywriting - A presentation by Andi Datin HardyantiSEO Copywriting - A presentation by Andi Datin Hardyanti
SEO Copywriting - A presentation by Andi Datin Hardyanti
 
Better UX = Better Web Conversion
Better UX = Better Web ConversionBetter UX = Better Web Conversion
Better UX = Better Web Conversion
 

Dernier

Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Call Girls In Delhi Whatsup 9873940964 Enjoy Unlimited Pleasure
 
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
soniya singh
 
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Call Girls In Delhi Whatsup 9873940964 Enjoy Unlimited Pleasure
 
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
soniya singh
 
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
shivangimorya083
 

Dernier (20)

Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
 
Networking in the Penumbra presented by Geoff Huston at NZNOG
Networking in the Penumbra presented by Geoff Huston at NZNOGNetworking in the Penumbra presented by Geoff Huston at NZNOG
Networking in the Penumbra presented by Geoff Huston at NZNOG
 
INDIVIDUAL ASSIGNMENT #3 CBG, PRESENTATION.
INDIVIDUAL ASSIGNMENT #3 CBG, PRESENTATION.INDIVIDUAL ASSIGNMENT #3 CBG, PRESENTATION.
INDIVIDUAL ASSIGNMENT #3 CBG, PRESENTATION.
 
How is AI changing journalism? (v. April 2024)
How is AI changing journalism? (v. April 2024)How is AI changing journalism? (v. April 2024)
How is AI changing journalism? (v. April 2024)
 
On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024
 
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...
 
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
 
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call GirlVIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
 
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
 
Russian Call girl in Ajman +971563133746 Ajman Call girl Service
Russian Call girl in Ajman +971563133746 Ajman Call girl ServiceRussian Call girl in Ajman +971563133746 Ajman Call girl Service
Russian Call girl in Ajman +971563133746 Ajman Call girl Service
 
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
 
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
 
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark WebGDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
 
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.
 
@9999965857 🫦 Sexy Desi Call Girls Laxmi Nagar 💓 High Profile Escorts Delhi 🫶
@9999965857 🫦 Sexy Desi Call Girls Laxmi Nagar 💓 High Profile Escorts Delhi 🫶@9999965857 🫦 Sexy Desi Call Girls Laxmi Nagar 💓 High Profile Escorts Delhi 🫶
@9999965857 🫦 Sexy Desi Call Girls Laxmi Nagar 💓 High Profile Escorts Delhi 🫶
 
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
 
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
 
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
 
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
 

Core Web Vitals Optimization for any website, especially WordPress

  • 2. • What • Steps • Examples Talking Points:
  • 3. What A set of metrics created by Google to ensure every visitor gets a positive user experience.
  • 4. Core Web Vitals measures the initial loading performance of the page measures how long it takes for visitors to interact with the page measures the amount of page layout shifts
  • 5. What Matters Most ➟ Above the Fold Area
  • 8. 1. Inline Critical CSS <style id="inlined-critical-css-example"> html, body { max-width: 100vw; overflow-x: hidden; background-color: #171717; font-weight: 400; font-size: max(16.5px,min(17px,(100vw - 100vmin))) } html { -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; box-sizing: border-box; } :root, html, body, button, input, select, textarea { font-family: thinkweb,Tahoma,Geneva,sans-serif; } ... </style> Can be created • Using online tools: 1. https://www.sitelocity.com/critical- path-css-generator 2. https://pegasaas.com/critical-path- css-generator/ • Manually Example:
  • 9. 2. Check the Loaded Assets Tools • Gtmetrix’s Waterfal Tab • Chrome Dev Tools Example:
  • 10. 3. Identify Unused Assets Tools • Chrome Dev Tools > Show Coverage Example:
  • 11. 4. Handling Unused CSS Tools • Remove: 1. Manually 2. Plugins • Purify: 1. https://purifycss.online/ 2. https://uncss-online.com/ • Remove • Purify
  • 12. 5. Handling Unused JavaScript Tools • Remove: 1. Manually 2. Plugins • Delay: 1. Flying Script (free) *WordPress 2. WP-Rocket (paid) *WordPress • Remove • Delay
  • 13. How to remove assets in WordPress /* to remove assets on every page */ function tw_unload_files() { wp_dequeue_style ( 'optim-style' ); // *_style is for css wp_dequeue_script ( 'jquery-core' ); // *_script is for JavaScript } add_action( 'wp_enqueue_scripts', 'tw_unload_files', 100 ); /* to remove assets on certain page or post-type */ function tw_unload_files() { if ( is_front_page() || is_page([page-id]) || is_single() || is_product() ) { wp_dequeue_style ( 'optim-style' ); wp_dequeue_script ( 'jquery-core' ); } } add_action( 'wp_enqueue_scripts', 'tw_unload_files', 100 );
  • 14. 6. Handling Images Tools • Compress: 1. Online Tools 2. Offline Tools • Delay: 1. Native Lazy Loading 2. JavaScript based • Image Dedicated CDN: Imagekit, Statically, AnyoneCDN, etc • Compress, Reduce, and Resize • Preload Critical Image • Delay Below the Fold Images • Use Image Dedicated CDN
  • 15. 7. Handling Fonts Basic Principles: • Limit the number of text fonts • Don’t use icon fonts Best Practices: • Self-host the font files • Purified and Inline the CSS • Preload critical font files
  • 16. 8. Handling Above the Fold Area 1. Make it simple a. Avoid using JavaScript driven content b. Simplify the HTML structure c. Limit the number of images 2. Make it fast & light a. Establish early connections of critical 3rd party resource b. Don’t combine CSS & JavaScript files c. Preload any critical assets d. Delay any non critical assets e. Use full HTML page cache
  • 17. q How to Establish Early 3rd Party Connection /* to pre-connect to the google fonts server */ <link rel="preconnect" href="//fonts.gstatic.com"> /* to prefetch the dns of google fonts */ <link rel="dns-prefetch" href="//fonts.gstatic.com"> Example: <link rel="preconnect" href="the-asset-source-domain-name"> <link rel="dns-prefetch" href="the-asset-source-domain-name">
  • 18. q How to Preload Files /* to preload image */ <link rel="preload" as="image" href="/wp-content/uploads/optimize-core-web-vitals-s.jpg"> /* to preload font */ <link rel="preload" as="font" href="https://fonts.gstatic.com/s/roboto/v20/KFOmCnqEu92Fr1Mu4mxKKTU1Kg.woff2" crossorigin> /* to preload JavaScript */ <link rel="preload" as="script" href="/wp-content/themes/generatepress/assets/js/main.min.js"> /* to preload CSS */ <link rel="preload" as="style" href="/wp-content/themes/generatepress/assets/css/main.min.css"> Example: <link rel="preload" as="the-asset-type" href="the-asset-url-path">
  • 19. Example / Case Study www.dewatalks.com