Unverified

Name

Remove Unused Javascript

About

Remove Unused Javascript - and improve your Page Speed Insight Score

Language

Javascript

Rating

Voted: 0 by 0 user(s)

Codevault

lightbulbman

Scroll down to see more snippets from this codevault.

Wordpress Compatability

The author has indicated that this snippet is compatable up to wordpress version: Not Specified

Code Snippet Plugin Sync

Free & Pro

Download this snippet by clicking the download button, then head over to the Code Snippet Plugin settings in your wordpress admin dashboard, select the import menu then upload this file to import into your wordpress site.

Pro Only (Coming Soon)

You will be able to click a button and sync this snippet to your wordpress site automatically and from your dashboard manage all code snippets across all your wordpress sites that have the Code Snippets Pro plugin installed.

Website/ Profile URL:

https://www.ecommercehints.com

History

Last modified:

10/09/2023

Important Note

This snippet has the following status:

Unverified

This snippet has not been verified, use with caution and at your own risk. See details provided by author in sidebar and click below to find out more.

Remove Unused Javascript

 
                    
1function wp_remove_scripts() {
2// check if user is admin or not?
3 if (current_user_can( 'update_core' )) {
4 return;
5 }
6 else {
7 // Check for the page you want to target
8 if ( is_page( 'homepage' ) ) {
9 // Remove Scripts
10 wp_dequeue_style( 'jquery-ui-core' );
11 }
12 }
13}
14add_action( 'wp_enqueue_scripts', 'wp_remove_scripts', 99 );
15// Update Test 1
16// Update Test 2
17// Update Test 3

0

Related Snippets

Please see some snippets below related to this snippet..

General

AI Verified

0

Add Tickets Pro plain meta data on WooCommerce Order for Zapier

Added: 11 months ago

Last Updated: 11 months ago

Alters the Modern Tribe Tickets Pro meta data to a simpler format on the WooCommerse Order so that it's easier to integrate with other systems on Zapier.

General

AI Verified

0

Drag-and-Drop Sorting CPT

Added: 8 months ago

Last Updated: 7 months ago

Draggable sorting for custom post types order by menu order

General

AI Verified

0

Image in RSS Feed from Post Content

Added: 2 years ago

Last Updated: 1 year ago

You can set first image from post content to show in RSS feeds

Other Snippets in this Codevault

These are some popular snippets from this users codevault..

WordPress Admin

AI Verified

1

Disable Wordpress Admin Bar Test

Added: 1 year ago

Last Updated: 5 months ago

There must be many of these - this is just my test I also want to see if line breaks are preserved in the description   should be free

Elementor

AI Verified

0

Custom Class for Elementor Form Widget Items

Added: 7 months ago

Last Updated: 7 months ago

Add custom classess to form elements using elementor; Note: if you want to add to other field types like select, then just add this to the allowed fields array: $allowed_fields just add the type, lik...

General

Unverified

0

Elementor Gradients Headings

Added: 1 year ago

Last Updated: 11 months ago

CSS Code for background gradients on headings in Elementor