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"? Commented Jun 13, 2020 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 Commented Jun 14, 2020 at 13:44

3 Answers 3


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. Commented Jun 14, 2020 at 13:44
  • 1
    @Readio Hi is there any way to find out which jquery-ui module code needs without going through the whole code with automation? Commented Sep 30, 2021 at 7:12
  • We created a new custom theme with no parent theme specified in XML - still loads all of Jquery-ui JS files... really frustrating :(
    – Paktas
    Commented Jul 19, 2023 at 10:55

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.

  • you can keep this file in your theme /web/compat.js
    – Dev
    Commented Apr 21, 2022 at 11:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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