Forums

Disable all javascript (8 posts)

  1. Nasul
    Member
    Posted 1 year ago #

    Is there any posibility to disable all the javascript in the teme? I use K2 1.1 and in the head there are 2 scripts loaded (jquery 1.4.2 and k2 min).

  2. You can remove it manually from the theme (just edit it and remove 'em), but I don't know if the theme will work without it.

    Why do you want it removed?

  3. Nasul
    Member
    Posted 1 year ago #

    I want to remove the javascript because why load something if is not usefull?
    And page load times will decrease.

  4. Well. Logically k2min is being used by your theme K2 ;)

    And jQuery is called by other WordPress functions. They shouldn't affect your load time that much.

  5. Nasul
    Member
    Posted 1 year ago #

    I know, but I am a speed freak.

    This code placed in functions.php can be used to disable all the scripts.

    remove_action( 'wp_print_scripts', array('K2', 'enqueue_scripts') );

  6. There is that. I suspect you'll find out some features no longer work, though, so ... good luck :)

    (If you're that much a speed freak, look into WP Super Cache, W3 Total Cache, and Minify as ways to speed things up without removing functionality.)

  7. Nasul
    Member
    Posted 1 year ago #

    I used the remove action and all the features I need work. I use W3 Total Cache and it is good for minifind and other things but why keep jquery and other scripts in the head when I don't need it?

  8. At that point, you may be better writing your own streamlined theme that omits all that stuff.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags