Skip to content
Advertisement

WordPress dequeue scripts only on single page

My website is using map functionalities that slow the whole site down dramatically.

I can dequeue them from the entire site with this add_action function:

JavaScript

My goal now is to dequeue these scripts on all but one page “/add-listing” where I need them so that users can still input their location.

Any tips on how to do that?

Advertisement

Answer

So, you can use something like that:

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement