Nofollow on events, organizers and venues

Home Forums Calendar Products Events Calendar PRO Nofollow on events, organizers and venues

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #1139580
    Omar
    Participant

    Hello!

    I need to set nofollow links on the events calendar on events, organizers and venues.

    I’ve tried it with the solution posted about setting nofollow on outgoing links to event organizer websites, but the code won’t work for internal nofollows.

    Do you have a solution for me?

    Best regards

    #1139933
    Nico
    Member

    Hi there Omar,

    Thanks for reaching out to us on this! I’ll help you getting this done ๐Ÿ™‚

    Iโ€™ve tried it with the solution posted about setting nofollow on outgoing links to event organizer websites, but the code wonโ€™t work for internal nofollows.

    Can you please point me to this solution?

    Also, Can you please specify in which screens you want to achieve this? It might need various template overrides if you want to do this for all single event links across the calendar (check more details in the themer’s guide).

    Please let me know about it,
    Best,
    Nico

    #1140176
    Omar
    Participant

    Hey Nico,

    Thanks for your quick response.

    Sure, i’ve tried the solution presented in this thread:

    adding Nofollow to event links

    add_filter( 'tribe_get_event_website_link', 'add_no_follow_event_website', 10, 2);
    
    function add_no_follow_event_website( $html ) {
    	//Strip out HTML
    	$url = strip_tags( $html );
    
    	//Add nofollow attribute
    	return sprintf( '<a href="%1$s" rel="nofollow" target="_self">%1$s</a>', $url );
    }
    

    I’ve tried to add a filter to :
    ‘tribe_get_venue_website_link’
    ‘tribe_get_day_link’
    ‘tribe_get_organizer_link’

    but unfortunately it didn’t work out.

    Basically the following structure or the following links should be made nofollow:

    /venue/specific_venue
    /organizer/specific_organizer
    /events/2016-xx-xx
    /event/specific_name_of_event

    Best regards

    • This reply was modified 9 years, 9 months ago by Omar.
    • This reply was modified 9 years, 9 months ago by Omar.
    #1140462
    Nico
    Member

    Thanks for clarifying Omar!

    The snippet you are using is actually working for me, but please note this in not the event link, but the external website link for the event: https://cloudup.com/cuGY79A63RP

    Regarding the other filters you mention, it looks like it should work for tribe_get_venue_website_link and tribe_get_organizer_link because as tribe_get_event_website_link, the functions are returning the link html element, while in the case of single events it’s only returning the URL for the event and the markup for the link is inside the template (and there are a bunch of templates to modify).

    If you don’t want the single pages for events, venues and organizer and day view, then it might be a better idea to print a robots meta tag with ‘noindex, nofollow’? Please let me know if this would work, if not I can see if there’s a hacky solution that might work for you.

    Have a great weekend,
    Nico

    #1140944
    Omar
    Participant

    Hey,

    Thanks for your quick reponse.

    Yes the snippet is working for the filters you’ve mentioned, unfortunately it’s not the filters which I need to work.

    I just need the links to the single organizer, single event and a specific venue to be nofollow.

    If you could afford me with a hacky solution that would be awesome.

    Regarding the robots I don’t know if it would work, as I’m not so experienced in writing robots.txt .

    Thanks and best regards!

    #1141004
    Nico
    Member

    Thanks for the follow-up Omar!

    Can yo please let me know what’s the goal of this customization? If you don’t want the single event, single organizer and single venue pages to be indexed by search engines, then it’s a better practice (and simpler to implement in this case) to add a meta tag in the head of the html that indicates search engines not to crawl the page. I’m not talking about adding a robots.txt just the tag in the html head.

    Please let me know about it,
    Best,
    Nico

    #1141469
    Omar
    Participant

    Hey!

    Goal of this customization would be to only index the main page of all events / organizers / venues, as a specific event will expire and customers on google can still search for it and will find it already taken place. The same is for venues and organizers.

    The meta tag should be a good plan in the html, so there are two options as I see:

    – nofollow on link outgoing from the list of all events / organizers …
    – noindex on specific page

    As for implementation I would think, that adding the noindex on specific events is way more simple.

    Best regards

    #1142174
    Nico
    Member

    Thanks for following up Omar!

    Please try pasting this snippet in your theme (or child theme) functions.php file:

    /* Tribe add noindex meta to single pages for event, venues & organizers */
    function tribe_noindex ( ) {

    global $wp_query;

    if ( empty( $wp_query->tribe_is_event_query ) ) {
    return;
    }

    $event_display = get_query_var( 'eventDisplay' );

    $add_noindex = ( ! $wp_query->have_posts() || 'month' === $event_display || 'single-event' === $event_display || tribe_is_event_venue() || tribe_is_event_organizer() );

    return $add_noindex;

    }

    add_filter ( 'tribe_events_add_no_index_meta', 'tribe_noindex' );

    This should add the <meta name="robots" content="noindex,follow" /> tag in the single pages for events, venues and organizers.

    Please give the snippet a try and let me know about it,
    Best,
    Nico

    #1142324
    Omar
    Participant

    Hey Nico,

    Thanks for your response. As I will be on vacation till Monday I can give you a feedback to the solution on Monday.
    Much thanks for your effort.

    Best regards

    #1142419
    Nico
    Member

    Thanks for the heads-up Omar! Enjoy your time out ๐Ÿ˜‰

    #1150998
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 11 posts - 1 through 11 (of 11 total)
  • The topic ‘Nofollow on events, organizers and venues’ is closed to new replies.