Saltar navegación

[Resuelto] dequeue toolset blocks/views & woocommerce views in pages where not used

This support ticket is created hace 3 años, 8 meses. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

Este tema contiene 1 respuesta, tiene 2 mensajes.

Última actualización por Luo Yang hace 3 años, 8 meses.

Asistido por: Luo Yang.

Autor
Mensajes
#2189809

Hello Toolset Support 🙂

I built a WP website using toolset (types + blocks + woo blocks) using kadence pro theme, kadence blocks and woocommerce. Use WP Rocket as cache plugin.
The site is a corporate site, has articles, news and "about us" pages and also has a catalogue of 250+ services from which visitors may ask for a quotation. I used woocommerce for the services, not for showing prices or having the cart, but to allow for better statistics. Created custom archives for services (products) and a content template for single_product.
Used toolset blocks for creating some custom archives for custom post types, some content templates in customs post types (insights, events) and for some views in just a couple of pages, all the rest is made using kadence blocks.
Everything works, however the scripts (css & js + jquery) from both toolset blocks and toolset woocommerce blocks are being loaded in every single page, no matter if it's not a woocommerce page (single product or archive) or if it has any of the toolset blocks in it's structure.
It's not a critical issue on desktop (although contributes to a poorer web vitals) but it's a critical issue on mobile, not only lowering the web vitals score, but also creating googlebot validation errors, for failing to load in mobile pages, thus rendering the screen blank.

My question is: how can I dequeue them from loading everywhere and just loading on the pages/archives where they are used?

Site link is on the ticket, I can provide admin access if needed.

Thanks in advance and best regards
Alex

#2190435

Hello,

There isn't such kind of built-in feature within Toolset plugins:
dequeue them from loading everywhere and just loading on the pages/archives where they are used
I suggest you follow our document to exclude some specific CSS/JS files from your cache plugin "WP Rocket":
https://toolset.com/faq/how-to-use-optimization-plugins-with-toolset/

Toolset loads the following main resource files on the front-end, depending on which Toolset plugins you have active...