Support » Plugin: Events Made Easy » Duplicate Title Tags on Single Event Pages

  • Resolved Ben Kaminski

    (@tzhben)



    Hi Franky, it’s me again. So, I’m having a huge problem with duplicate title tags coming from the single event pages. While I found a great answer on your plugin site, it only seems to work on the event pages and destroys my regular titles and metas I’m using via Yoast SEO, which utilizes the WordPress “title_tag” support. The workaround on your plugin site doesn’t seem to take into account the “title_tag” support and wants to utilize the old method of placing the “title” tag in the header.php which is null due to title tag support.

    Being that I want my event titles to show event names, dates, and location… I want to be able to do this while still being able to use Yoast SEO to handle page titles and metas. Is this possible?

    Thanks.

    BEN

Viewing 3 replies - 1 through 3 (of 3 total)
  • Never mind… the folks at stack overflow helped with this one:
    Duplicate Title Tags in Event Pages

    Here is the workaround for anyone struggling with this. Add the following to your functions.php file:

    add_action("wp_head", function () {
    
        if (eme_is_single_event_page()) {
    
            $extra_headers_format = get_option('eme_event_html_headers_format');
    
            if (!empty($extra_headers_format)) {
                remove_action( 'wp_head', '_wp_render_title_tag', 1 );
            }
    
        }
    
    }, 0); // priority 0 to be launched before the call of "_wp_render_title_tag"
    Plugin Author Franky

    (@liedekef)

    Nicely done. However, did you check the faq on https://www.e-dynamics.be/wordpress/faq/ for yoast? While your approach works, normally the title-tag is set in your template using a call to wp_title and EME uses the standard wp filter single_post_title to set the correct title.

    Franky! Thanks… no I did not look at the FAQ, I tend to avoid them but your swapping out the OG tag there really helped as well. I kept my function in place for the page titling, but the replacing of the open graph tags using placeholders works great too! THanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.