Site logo

Archived topic

Does Generatepress Use JQeury?

17 replies · Started by Benjamin on December 15, 2021

Viewing posts 1–15 of 18

Hello, I use Ezoic to optimize my websites.

They have a technologies tab of tech slowing down your website. There are 3 technologies that I'm not sure where they are coming from on my site that seem to be slowing things down a lot- namely JQuery, jQuery Migrate, and jQuery Matchheight- are these added by GP/ GP Premium possibly? Just trying to find the root.

Thanks!

Hi there,

GP only requires jQuery and only enqueues it if you have the Sticky Navigation enabled. But plenty of WP plugins require jQuery. If you're not using sticky nav, or your disable it, and jQuery still loads then its not GP making the request.

Hello David,

Thanks. I see the sticky nav falls under menu plus and I have that disabled so can't be that. What about Generateblocks perhaps? But as you said it could be any plugin, although I only use a few.

I'll link the site in the private section if you want to have a look, but no need if you're busy.

Take care.

WP Show Posts uses it in some instances.
If you force jQuery to not load then you would need to disable the matchHeight script in WP Show Posts. Tom provides a snippet for that here:

https://wpshowposts.com/support/topic/design-question/#post-18421

But i cannot say if there aren't other plugins that are dependent on jQuery

Sure thanks,

What exactly does the match height do? Is it fine to remove it?

Its for resizing grids so each column occupies the same height. Remove it and see if you notice any difference.

Okay cool, where does that code need to go? Functions.php? If there I'll probably have to use the codesnippets plugin.

1. Yeah functions.php in Child Theme or in the Code Snippets plugin.
2. And thats the correct Code.

And just as a final piece add this to your functions.php:

// Disable Jquery
add_filter( 'wp_enqueue_scripts', 'change_default_jquery', PHP_INT_MAX );

function change_default_jquery( ){
	
	if ( ! is_admin() ) {
    	wp_dequeue_script( 'jquery');
    	wp_deregister_script( 'jquery');   

	}
}

This will remove jQuery from the front end. But you need to make sure there are no other plugins that require it.

Cool thanks. I own the perfmatters plugin for removing a bunch of scripts and I also have Ezoic which removes scripts of it own. I'll just check if I can get rid of JQUERY there before I add the JQeury code.

Also, as far as I know WP Show Posts will become part of GP Blocks somewhere in 2022? Will it still use the match height then as I know GP Blocks is quite lightweight. Might not want that code in there?

Also, as far as I know WP Show Posts will become part of GP Blocks somewhere in 2022?

It will be part of GenerateBlocks pro and likely in 2022 :)

Hi just regarding the code David gave to remove Jquery from the front end- this doesn't remove Jqeury core right? (Not sure if you need Jquery core, but I think you do).

thanks!

It should remove jQuery overall.

Alright sure, I'll try it out then and see if there are conflicts. Perhaps a good idea to make sure with all the developers of the plugins I use. Luckily I don't have many.

I might as well start here-

    WP Show Posts (Uses Jqeury Matchheight- reason for ticket- but will test) anything else?
    Generateblocks
    Generatepress/ GP Premium

Could you just confirm that any of these above don't use jquery? Apart from what is mentioned.

Thanks.

And while we're at it can you just confirm if any of those use Jquery Migrate also? Thanks.

This archived topic is closed to new replies.