Home › Forums › Calendar Products › Events Calendar PRO › How to remove "meta, link & scripts" from "wp_head" on custom page template
- This topic has 7 replies, 2 voices, and was last updated 8 years, 9 months ago by
Brent Kozlowski.
-
AuthorPosts
-
July 12, 2017 at 2:05 pm #1320236
Brent Kozlowski
ParticipantHow do I prevent the following from showing in wp_head on my custom page template?
<meta name="tec-api-version" content="v1"><meta name="tec-api-origin" content="http://localhost/sister"><link rel="https://theeventscalendar.com" href="http://localhost/sister/wp-json/tribe/events/v1/" /><script> ( function ( body ) { 'use strict'; body.className = body.className.replace( /\btribe-no-js\b/, 'tribe-js' ); } )( document.body ); </script> <script type='text/javascript'> /* <![CDATA[ */var tribe_l10n_datatables = {"aria":{"sort_ascending":": activate to sort column ascending","sort_descending":": activate to sort column descending"},"length_menu":"Show _MENU_ entries","empty_table":"No data available in table","info":"Showing _START_ to _END_ of _TOTAL_ entries","info_empty":"Showing 0 to 0 of 0 entries","info_filtered":"(filtered from _MAX_ total entries)","zero_records":"No matching records found","search":"Search:","pagination":{"all":"All","next":"Next","previous":"Previous"},"select":{"rows":{"0":"","_":": Selected %d rows","1":": Selected 1 row"}},"datepicker":{"dayNames":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],"dayNamesShort":["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],"dayNamesMin":["S","M","T","W","T","F","S"],"monthNames":["January","February","March","April","May","June","July","August","September","October","November","December"],"monthNamesShort":["January","February","March","April","May","June","July","August","September","October","November","December"],"nextText":"Next","prevText":"Prev","currentText":"Today","closeText":"Done"}};/* ]]> */ </script>-
This topic was modified 8 years, 9 months ago by
Brent Kozlowski.
-
This topic was modified 8 years, 9 months ago by
Andras.
July 13, 2017 at 11:35 am #1320756Andras
KeymasterHi bkowlowski,
Thanks for reaching out!
I have to ask for some time until I get some help for most of that.
Meanwhile this snippet should help you remove part of that script:
if ( class_exists( 'Tribe__Main' ) ) { remove_action( 'wp_footer', array( Tribe__Main::instance(), 'toggle_js_class' ) ); }I’ll be in touch as soon as I have something.
Cheers,
AndrasJuly 13, 2017 at 11:40 am #1320763Andras
KeymasterHere’s one more:
if ( function_exists( 'tribe' ) ) { remove_action( 'wp_head', array( tribe( 'tec.rest-v1.headers' ), 'add_header' ) ); }Check these and let me know how it works out!
Cheers,
AndrasJuly 13, 2017 at 2:19 pm #1320855Brent Kozlowski
ParticipantThanks! Those both worked, but still need something to remove this one from the footer.
<script type='text/javascript'> /* <![CDATA[ */var tribe_l10n_datatables = {"aria":{"sort_ascending":": activate to sort column ascending","sort_descending":": activate to sort column descending"},"length_menu":"Show _MENU_ entries","empty_table":"No data available in table","info":"Showing _START_ to _END_ of _TOTAL_ entries","info_empty":"Showing 0 to 0 of 0 entries","info_filtered":"(filtered from _MAX_ total entries)","zero_records":"No matching records found","search":"Search:","pagination":{"all":"All","next":"Next","previous":"Previous"},"select":{"rows":{"0":"","_":": Selected %d rows","1":": Selected 1 row"}},"datepicker":{"dayNames":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],"dayNamesShort":["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],"dayNamesMin":["S","M","T","W","T","F","S"],"monthNames":["January","February","March","April","May","June","July","August","September","October","November","December"],"monthNamesShort":["January","February","March","April","May","June","July","August","September","October","November","December"],"nextText":"Next","prevText":"Prev","currentText":"Today","closeText":"Done"}};/* ]]> */ </script>July 14, 2017 at 6:42 am #1321182Andras
KeymasterI managed to get a dev to take a look at this.
While there is no great way to remove this you can do it with this snippet:
add_action( 'init', function() { if ( function_exists( 'tribe' ) ) { remove_action( 'wp_footer', array( tribe( 'tribe.asset.data' ), 'render_json' ) ); } } );Please note though that a number of our scripts depend on that data, so removing this has the potential to cause breakages.
Cheers,
AndrasJuly 14, 2017 at 11:11 am #1321400Brent Kozlowski
ParticipantThanks!. This is only for a custom landing page template that needs to be super fast. Can’t have anything unnecessary loading that isn’t critical to that page.
July 17, 2017 at 5:48 am #1322059Andras
KeymasterGlad it helps!
Since this is marked resolved I am going to close this ticket, but if you need anything else related to this topic or another please post a new one in the forum and we will be happy to help you out.
Good luck with your project!
Cheers,
Andras -
This topic was modified 8 years, 9 months ago by
-
AuthorPosts
- The topic ‘How to remove "meta, link & scripts" from "wp_head" on custom page template’ is closed to new replies.
