Home › Forums › Calendar Products › Events Calendar PRO › Stop Google from Indexing my Events
- This topic has 5 replies, 4 voices, and was last updated 9 years, 6 months ago by
Rob.
-
AuthorPosts
-
September 27, 2016 at 9:33 am #1169254
Rob
ParticipantIs there a way that I can stop search engines from indexing the events on my site?
September 27, 2016 at 10:42 am #1169340George
ParticipantHey Rob,
Thanks for reaching out!
To be clear, are you trying to leave everything else on your site searchable and indexable by search engines? So that, i.e., you only want to prevent indexing on events?
Or do you want to prevent index of all content on your site?
Cheers,
GeorgeSeptember 27, 2016 at 11:52 am #1169386Rob
ParticipantHi George,
We have a number of sites that have private area events and do not want google to index these particular events. I figured it may be easier just to block all events from indexing rather than just particular ones.
What is the best way to accomplish this? Robot.txt file?
Rob
September 27, 2016 at 4:22 pm #1169550George
ParticipantHey Rob,
Thanks for clarifying this a bit.
It is tricky to target just events, especially a subset of events. However, you do have a few options here.
You can use robots.txt as you suggest; learn more about using that here → http://www.robotstxt.org
Another option is to add robots meta tags to the HTML head of any events document…the main /events/ page, single events, etc.
I wrote up a snippet for you that should do just that:
if ( class_exists( 'Tribe__Events__Main' ) ) {function tribe_limit_search_indexing_of_events() {
if ( tribe_is_event() ) {
echo '<meta name="robots" content="noindex, nofollow">';
}
}add_action( 'wp_head', 'tribe_limit_search_indexing_of_events' );
}
☝️ I tested this and it worked well for me on my local site—in terms of adding the proper meta tags, anyways.
Like with any limitation imposed on indexing—whether by robots.txt, or .htaccess, or meta tags, etc.—these limitations are requests. It is fundamentally up to the search engines to honor that request.
So, regardless of what method you choose it may take some time before you notice changes in effect.
Let me know if this information helps, and if there are any further questions I can try to help with!
Sincerely,
GeorgeOctober 19, 2016 at 9:35 am #1179182Support Droid
KeymasterHey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.
Thanks so much!
The Events Calendar Support Team -
AuthorPosts
- The topic ‘Stop Google from Indexing my Events’ is closed to new replies.
