Home › Forums › Calendar Products › Events Calendar PRO › How disable wp-json of tribe events?
- This topic has 7 replies, 2 voices, and was last updated 8 years, 7 months ago by
Gabriel.
-
AuthorPosts
-
August 16, 2017 at 1:30 pm #1336347
Gabriel
ParticipantHello,
My site is getting slow and we are investigating causes.
Currently our home: https://www.titanesmedellin.com/ has 4 Tribe Events ShortCodes that loads the basic info of 4 events.
Evaluating our home with https://tools.pingdom.com/ appears very slow files, both with this call:
– x-tec-api-root > https://www.titanesmedellin.com/wp-json/tribe/events/v1/We are thinking that wp-json is slowing our site so we want disable with “Disable REST API” plugin.
If we do it, the Tribe Events Shortcodes will ge the events info directly from database?Thanks
August 17, 2017 at 7:03 pm #1337161Victor
MemberHola Gabriel!
Thanks for reaching out to us!
I’m really sorry you are experiencing performance issues. I know for myself they can be really hard to tackle, so I really sympathise with this.
We have a great article that will get you started on Performance Considerations you should know about. After that, if you decide to implement a caching system then you can move to these articles: Caching: What, when and how and Caching month view HTML in transients
Finally, there is a good article George put up here that groups a set of developer plugins. It’s a bit more technical than the others but will definitely be of help if you are into development.
We are thinking that wp-json is slowing our site so we want disable with “Disable REST API” plugin.
If we do it, the Tribe Events Shortcodes will ge the events info directly from database?I’m not really sure about this fact. I will reach out to the team to have a second opinion on this topic and will get back to you with a more solid answer.
Please hang in there.
Thanks,
VictorAugust 19, 2017 at 7:03 am #1337703Gabriel
Participantok.. Thanksss!!
August 21, 2017 at 6:40 am #1338078Victor
MemberHi Gabriel!
Thanks for your patience.
If you disable the REST API, the tribe events shortcodes should still work.
You can use the following code to disable The Events Calendar’s REST API functionality:
* Note that trying to import events from a site with the REST API disabled... * into another site running The Events Calendar... via Event Aggregator... * will cause this import setup/scheme to no longer function, since * Event Aggregator uses the REST API to pull events from one TEC site * into another TEC site. // advertise to the world that the REST API is disabled add_filter( 'tribe_events_rest_api_enabled', '__return_false' ); // actually disable REST API functionality add_action( 'init', function () { remove_action( 'rest_api_init', array( tribe( 'tec.rest-v1.main' ), 'register_endpoints' ) ); }, 5 );I hope that helps! Let me know if you have other questions.
Best,
VictorAugust 24, 2017 at 3:35 am #1339593Gabriel
ParticipantHello.. Where I add this code?
Thanks!August 24, 2017 at 6:34 am #1339680Victor
MemberHi Gabriel!
I’m sorry I wasn’t clear enough. You can add this code in your active theme’s functions.php file.
Let me know if it works for you.
Best,
VictorSeptember 15, 2017 at 9:36 am #1349783Support Droid
KeymasterHey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.
Thanks so much!
The Events Calendar Support Team -
AuthorPosts
- The topic ‘How disable wp-json of tribe events?’ is closed to new replies.
