I want to remove jquery ui from magento 2.3 custom theme i used the following

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
        <!-- Remove blank/luma theme styling if you declared a parent-->
        <remove src="css/styles-m.css" />
        <remove src="css/styles-l.css" />
        <remove src="css/print.css" />
        <remove src="lib/web/jquery/jquery.js"/>
        <remove src="js/jquery-ui.js"/>

But it's not working. any help would be appreciated

  • Have you tried by setting the src = "Magento_Theme::js/jquery-ui.js"? Jun 13 '20 at 18:34
  • @Bhaumik1987 unfotunately it's not working. I am already in Magento_Theme so it does not make any sence. but thanks alot Jun 14 '20 at 13:44

You can remove the core jquery-ui.js file using this:

<remove src="Lib::jquery/jquery-ui.js" />

Unfortunately, it's not a simple a that. Because Magento is using jQuery UI modules throughout its code, it then falls back to importing individually each jquery-ui module using requireJS, like below:


If you want to remove all jQuery/jQuery UI code I'd suggest you might be better off not setting any of the Magento themes as the parent/fallback and literally starting from scratch with your custom theme. I have done this with previous projects. The result is really clean code only you write, but the amount of work building all the default front-end functionality is huge.

  • Thank you. yeah your are right. Jun 14 '20 at 13:44
  • @Readio Hi is there any way to find out which jquery-ui module code needs without going through the whole code with automation? Sep 30 at 7:12

thats such idiotic thing to force people to use completely useless javascripts that only slow down your site... if anyone wants to use DATEPICKER for example let them install it themselfs, instead brilliant brains of magento decided everyone wants to use such a useless thing for ecommerce site as datepicker that weights 40kb lol


You can directly remove the widgets which you dont use in your project in this file<magento_root>/lib/web/jquery/compact.js Although you need to keep track of this file, while deploying to production. I wish there was better way to remove so many ununsed widgets and had better way to add new/updated widgets.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.