-
Notifications
You must be signed in to change notification settings - Fork 213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stop WP rocket preloading all fonts it finds in the css when 'Remove unused css' is turned on #6202
Comments
Hello @be6945 thanks for creating the issue. Could you send me the website which has a worse LCP when preloading the fonts? We'd like to see what's the problem there, you could reach me at piotr[at]wp-media.me. |
@piotrbak Example here reported on the forum where 319kb of fonts are loaded that arent used above the fold: All fonts should not be preloaded by default. There is no logic in that - especially when there is likely only 1 or 2 fonts to load above the fold. |
Indeed, every single website I work on loads multiple icon librairies (fontawesome, eicons, ...). Which hugely impacts LCP since we are preloading them. Having a text box to exclude fonts from preloading is becoming a priority on my end. I would like to know if there's anything planned regarding this, thank you very much. |
I support it, it greatly affects the LCP metric, especially when there is a font with icons. |
Hi, I confirm that this behavior can be really problematic and impact LCP in a bad way. You should at least provide a hook to blacklist some fonts based on name. |
I have also had this issue. I am already preloading the fonts that we need. Disabling this feature increased LCP by 10 points. I did try to use this |
Hola, quisiera pedirte amablemente que utilices un acortador de URL al referirte a mi sitio, ya que estoy trabajando en su optimización para los motores de búsqueda y preferiría que cuando alguien busque el nombre de mi marca, encuentren el contenido de mi sitio web, que ofrece servicios odontológicos, en lugar de esta discusión. Aunque enfrenté problemas de velocidad en el pasado, ahora he pasado la Evaluación de las métricas web esenciales en PageSpeed tanto en dispositivos móviles como en ordenadores. Gracias por tu comprensión. |
Maybe @wordpressfan can help us with this quick request here ? |
I'm also facing this issue in some websites. With Elementor for example all the font awesome files are preload even if you're not using the font in the page. Would be great to have a way to exclude fonts for be preloaded. |
We have a filter to completely remove this On the long term, this would need to be solved on the SaaS side. What happens on the plugin side is that we get the used CSS sent by the SaaS, parse it to extract the fonts URLs, and preload them. We don't know which ones are currently used on the page. Ideally, the SaaS would return the used CSS with only the fonts used on the page, and it would solve the issue. |
@Tabrisrp sounds like filter with exclusions of specific fonts would be a quick workaround for this problem. It should be an easy thing to implement, right? |
Yes it can be a quick solution that can be used by the users or with an helper plugin |
Let's go with this approach then for now:
|
Scope a solution ✅
|
Great to see this being accepted as an issue, thank you. Please let us know how to implement too. Thanks again everyone, great work. |
Is your feature request related to a problem? Please describe.
When using the 'Remove unused css' feature, WP-rocket pre-loads all fonts it finds in the CSS files. This causes many unwanted fonts to be pre-loaded (especially those from plugin files) and affects LCP etc.
Describe the solution you'd like
A toggle button on whether to preload fonts it finds or not when using this feature.
Describe alternatives you've considered
Using a different optimization plugin.
The text was updated successfully, but these errors were encountered: