[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now


Scripts & Style Sheets only used on required pages.

Posted on 2014-02-12
Medium Priority
Last Modified: 2014-02-13
Some of my wordpress websites have many plugins which generate lots of links to Scripts & Style Sheets.

Some of these Scripts & Style Sheets are only required on one page however Wordpress links to them on every page usually via the header.

Does anyone know of a method or plugin to restrict Scripts & Style Sheets used only the ones used on the relevant page?
Question by:petewinter
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
LVL 70

Expert Comment

by:Jason C. Levine
ID: 39854374
How is the "relevant page" to be determined?  All WordPress knows is that you have installed something.

Author Comment

ID: 39854413
Open to idea's. Can it be done via template?
LVL 70

Expert Comment

by:Jason C. Levine
ID: 39854573
Sort of.  The issue is that the plugins are the ones adding the calls to the files so any solution involving conditional code would probably involve altering the plugin.  Once you do that, you either have to fork it or not update it as the next update will blow away any changes.
Simplify Your Workload with One Tool

How do you combat today’s intelligent hacker while managing multiple domains and platforms? By simplifying your workload with one tool. With Lunarpages hosting through Plesk Onyx, you can:

Automate SSL generation and installation with two clicks
Experience total server control

LVL 84

Expert Comment

by:Dave Baldwin
ID: 39854932
Why do you want to do this?  What is your goal?

Author Comment

ID: 39855453
I want to reduce calls and help page speed
LVL 70

Accepted Solution

Jason C. Levine earned 2000 total points
ID: 39855461
The better way to do this may be to minify and combine CSS and JS files.  W3 Total Cache can do it or you can hook onto a CDN service that will do it too.

Author Closing Comment

ID: 39855602
Okay. Thanks for the advice

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The purpose of this video is to demonstrate how to exclude a particular blog category from the main blog page. This is can be used when a category already has its own tab, or you simply want certain types of posts not to show up on the main blog. …
The viewer will learn how to dynamically set the form action using jQuery.
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question