json errors and 404s

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.
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #1506024
    Ann Premazon
    Participant

    Hey 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-anon

    Any help would be great.

    – Arthur

    [email protected]

    #1507031
    Patricia
    Member

    Hi 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

    #1507046
    Ann Premazon
    Participant

    Thank 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.

    #1508322
    Patricia
    Member

    Hi 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

    #1508593
    Ann Premazon
    Participant

    This 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.

    #1509737
    Ann Premazon
    Participant

    Haven’t heard a response in a day. Hoping to hear an answer soon.

    Thank you.

    #1509782
    Patricia
    Member

    Hi 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

    #1511173
    Ann Premazon
    Participant

    This has seemed to work. Thank you for you help.

    #1512231
    Patricia
    Member

    You 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

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘json errors and 404s’ is closed to new replies.