Home › Forums › Calendar Products › Events Calendar PRO › Remove Scripts & Styles from pages that do not use Events Calendar features
- This topic has 4 replies, 5 voices, and was last updated 7 years, 10 months ago by Geoff.
-
AuthorPosts
-
May 18, 2016 at 4:49 pm #1116190Brent KozlowskiParticipant
Hello,
I’m in the process of optimizing my site and it appears that Events Calendar and all of its addons are being called on every page. Is it possible to wp_deregister_script & wp_deregister_style for pages that don’t contain the post type “tribe-events” and event calendar shortcodes?
I found a solution from 3 years ago, but I’m hoping you have an end all solution for this similar to Contact Form 7 and a lot of other plugins?
Thanks!
May 18, 2016 at 8:45 pm #1116231BrookParticipantHowdy bkozlowski,
Thanks for taking the time to reach out about this. Truth be told we view this as a bug, we don’t want our scripts loading on other pages anymore than you do. Site performance is a top consideration in our book.
The solution from 3 years ago does not look super relevant today. Over the years thais has been an issue that disappears and reappears. You will see this problem mentioned in a few forums posts over the years, but often times it is a different script in each one people are trying to get rid of. We are working on fundamentally reworking this system so that it is inherintly better and more resistant to this sort of problem.
Until then here was a recently tested solution to this problem. As you can see George tested Diane’s code, but he hooked using:
add_action( 'wp_enqueue_scripts', 'dequeue_tribe_events_scripts_and_styles' );
I suspect Diane was initially having issues because she did not hook the right action. Does that solution work for you?
PS. I added your topic to those who would be interested in being notified when this bug is fixed. We will respond here once an updated release is out that contains a fix.
Cheers!
– Brook
June 2, 2016 at 9:35 am #1121698Support DroidKeymasterThis topic has not been active for quite some time and will now be closed.
If you still need assistance please simply open a new topic (linking to this one if necessary)
and one of the team will be only too happy to help.July 7, 2016 at 12:26 pm #1136780GeoffMemberHey there,
We wanted to follow-up to let you know that we were able to patch this up in The Events Calendar and Events Calendar PRO 4.2.2, which is now available to download and install if you haven’t done so already.
Please do be sure to check out our release notes for a full overview of what’s new in the release and feel free to let us know if you run into this or any other issues after the update.
Thanks so much for your patience while we worked on this!
Cheers,
Geoff -
AuthorPosts
- The topic ‘Remove Scripts & Styles from pages that do not use Events Calendar features’ is closed to new replies.