Home › Forums › Calendar Products › Events Calendar PRO › json errors and 404s
- This topic has 8 replies, 2 voices, and was last updated 8 years ago by
Ann Premazon.
-
AuthorPosts
-
April 12, 2018 at 1:42 pm #1506024
Ann Premazon
ParticipantHey there
We’re running website auditor from SEO Powersuite and we’re getting these errors. Links like this show up as 404.
https://www.newdirectionsforwomen.org/wp-json/tribe/events/v1/events/?tags=al-anonAny help would be great.
– Arthur
April 13, 2018 at 12:57 pm #1507031Patricia
MemberHi Ann,
Thank you for reaching out to us!
This URL (wp-json/tribe/events/v1/events) is used by The Events Calendar REST API to provide the raw data about an event (without all the presentation stuff surrounding it): it looks like someone on your team is/was trying to return events with a specific tag via REST API.
I hope this helps! If you have any other questions at all please feel free to let me know and I’d be happy to help as best I can!
Cheers,
Patricia
April 13, 2018 at 1:08 pm #1507046Ann Premazon
ParticipantThank you for getting back to us.
Is there a way to block this from showing up. We don’t use the Rest API for anything. It’s throwing off our SEO scans.
April 16, 2018 at 10:07 am #1508322Patricia
MemberHi Ann,
You can add the following snippet to your theme’s functions.php file to disable The Events Calendar REST API. Please 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 this helps! If you have any other questions at all please feel free to let me know and I’d be happy to help as best I can!
Cheers,
Patricia
April 16, 2018 at 1:53 pm #1508593Ann Premazon
ParticipantThis has helped a lot. All of 404 errors have disappeared however we seem to have a 401 error that is showing up.
<link rel="https://theeventscalendar.com/" href="https://www.newdirectionsforwomen.org/wp-json/tribe/events/v1/" />Is there a way to have this removed from the header? I’m almost certain this is to support features that my client doesn’t need.
April 17, 2018 at 3:21 pm #1509737Ann Premazon
ParticipantHaven’t heard a response in a day. Hoping to hear an answer soon.
Thank you.
April 17, 2018 at 6:47 pm #1509782Patricia
MemberHi there,
I’d like to apologize for the delay in response. It’s been really busy in the forums lately, and we’re doing our best to adhere to our Scope of Support / Terms for you and everyone else.
Answering your question, it is possible to remove this header with the following snippet:
if ( function_exists( 'tribe' ) ) {
remove_action( 'wp_head', array( tribe( 'tec.rest-v1.headers' ), 'add_header' ) );
}Please give it a try and let me know if it works as expected.
Thanks!
Patricia
April 19, 2018 at 6:56 am #1511173Ann Premazon
ParticipantThis has seemed to work. Thank you for you help.
April 20, 2018 at 8:38 am #1512231Patricia
MemberYou are welcome! If you need an assistance again or have other concerns, please feel free to open up a new thread, we’ll be more than happy to help you!
Cheers,
Patricia
-
AuthorPosts
- The topic ‘json errors and 404s’ is closed to new replies.
