Support

Home Forums Event Espresso Premium Venue and start date in URL – SEO

Venue and start date in URL – SEO

Posted: July 1, 2015 at 4:35 am


Gregor

July 1, 2015 at 4:35 am

Hi
I’m using SEO Yoast and i would like to have following:
– url of event should have (SEO reasons) a venue and possible starting date
– there are some tags that we can use to create SEO title. What to use to show venue in Event Title (SEO)?

Thank you


Dean

July 1, 2015 at 6:34 am

Hi,

In EE4, events and venues are post types, so they follow the same URL structure as a standard Post or Page.

You can, for instance, edit the Permalink in the event/venue editor and add in the appropriate information.

Alternatively you could simply add the venue/date to the event title when creating the event and this will be incorporated into the the permalink.

It isn’t possible to insert venues and dates into the page title via the Titles & Metas > Post Types section in WordPress SEO.

Instead you would need to get creative and use the various filters that the WordPress SEO plugin provides: https://yoast.com/wordpress/plugins/seo/api/

As a very basic example:

function wpseo_title_change( $string ) {

  global $post;

  //get the venues associated with this event.
  $ven = $post->EE_Event->venues();

  //loop through them (even though there is only one).
  foreach ($ven as $venue) {
    //add the venue name after the SEO title with a dash
    $string = $string . ' - ' . $venue->name();
  }

  return $string;

}

add_filter( 'wpseo_title', 'wpseo_title_change', 10, 1 );

The above is just an example and should not be used on a production site. It will however be a good starting point for your own/your developers work.

We have some developer related documentation here that may assist:
http://code.eventespresso.com/


Gregor

July 1, 2015 at 7:23 am

Hi Dean

Thank you for reply. I’ll stick to Venue in title .. should have come up with this idea by myself 🙂

Thank you

The support post ‘Venue and start date in URL – SEO’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Support forum for Event Espresso 3 and Event Espresso 4.
Documentation for EE3 and EE4
Documentation for Event Espresso 3

Documentation for Event Espresso 4

Status: closed

Updated by  Gregor 4 years, 4 months ago ago

Topic Tags

Tagged: ,

Notifications

This topic is:
pending
Do NOT follow this link or you will be banned from the site!
[for="input_96_5_3"]
[for="input_96_5_3"]
[gravityform id=96 title=false description=false]
  • This field is for validation purposes and should be left unchanged.
[i]
[i]
[gravityform id=69 title=false description=false]
  • This field is for validation purposes and should be left unchanged.