Support » Plugin: The Events Calendar » Bug rel Prev and Next 404 errors

  • Resolved Daniel Chase

    (@riseofweb)


    First off, thank you for creating this wonderful plugin.

    If you view the source of the past events archive (example URL: https://www.example.com/events/list/?tribe_event_display=past&tribe_paged=13), In the <head> it shows:

    <link rel="prev" href="https://www.example.com/events/page/12/" />
    <link rel="next" href="https://www.example.com/events/page/14/" />

    These link-hrefs go to 404 errors. This is bad for web crawlers. Note I also have Yoast SEO installed. Is this an issue with your plugin, Yoast SEO, or both?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Jaime

    (@jaimemarchwinski)

    Hi @riseofweb

    Thanks for reaching out!

    I just tested this out on my local site, and the links there which are tied to the previous and next arrows on that page do not lead to 404s.

    It’s possible that this is tied to Yoast, because I was not able to replicate the issue without it.

    Let me know if that helps!

    Thanks,
    Jaime

    Thread Starter Daniel Chase

    (@riseofweb)

    @jaimemarchwinski Thank you for your response and for looking into it for me.

    I found that the issue is with the Yoast SEO Plugin. When Yoast is disabled it does not show the next and prev rel links in the head.

    I manage multiple websites with both Yoast SEO and your plugin installed. I found identical issues on all websites that have the 2 plugins installed.

    So I have to assume that this is a compatibility issue between the 2 plugins.

    I created a filter in my theme’s functions to make Yoast SEO compatible with your plugin:
    https://gist.github.com/amboutwe/66c583d2ef4015a8a244ee3e0e8cd1a0

    Here is what I implemented. So far this seems to do the trick.

    
    //Tribe Events Calendar - Past Events - Yoast SEO Compatibility Fix
    add_filter( 'wpseo_next_rel_link', 'custom_remove_wpseo_next_prev' );
    add_filter( 'wpseo_prev_rel_link', 'custom_remove_wpseo_next_prev' );
    function custom_remove_wpseo_next_prev( $link ) {
    	$queryURL = parse_url( html_entity_decode( esc_url( add_query_arg( $arr_params ) ) ) );
    	parse_str( $queryURL['query'], $getVar );
    	$pastEvent = $getVar['tribe_event_display'];
         if ( htmlspecialchars($pastEvent) == "past" ) {
              return false;
         } else { 
              return $link;
         }
    }
    
    • This reply was modified 7 months, 4 weeks ago by Daniel Chase.
    Plugin Support Jaime

    (@jaimemarchwinski)

    Hi @riseofweb

    I’m glad to hear that you were able to find a solution here and thanks for sharing!

    I’m going to mark this thread as Resolved, but feel free to open up a new one if anything else comes up.

    Have a wonderful day!

    Thanks,
    Jaime

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Bug rel Prev and Next 404 errors’ is closed to new replies.