Even Better SEO for Events, Locations

Events Made Easy Forums Tips Even Better SEO for Events, Locations

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #60822
    allenfreeman
    Participant

    There are a couple of posts under “How to make EME and Yoast play nice together?” at https://www.e-dynamics.be/wordpress/faq/ discussing how to make Yoast behave better with the Events page and dynamic events and locations.

    I followed the instructions on the FAQs to add dynamic titles, get OG tags, etc but found one more issue: Google wouldn’t crawl the site because Yoast added a page canonical that overrode the dynamic canonical.

    So in addition to the suggested code for the functions.php file, I also added the following (found on stack):

    
    add_filter( 'wpseo_canonical', 'yoast_remove_canonical_items' );
    
    function yoast_remove_canonical_items( $canonical ) {
      if ( is_page ( 3475 ) ) {
        return false;
      }
      /* Use a second if statement here when needed */
    	return $canonical; /* Do not remove this line */
    }
    
    

    Any comments to better this are welcomed…

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.