-
-
Notifications
You must be signed in to change notification settings - Fork 824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CRM-21639 NOINDEX Event Info page when event is non-public or in the past #11496
CRM-21639 NOINDEX Event Info page when event is non-public or in the past #11496
Conversation
@colemanw what do you think about this? I think it should go in a function ie. SetNoIndex - but perhaps you have some ideas about a generic approach? |
just for reference: I also submit this PR on (no)indexing of the Print Preview pages #11498 |
I'm not sure I agree that the event should be NOINDEX when the event is closed? It could still be a useful information that people might want to search for? Also, the event registration might be closed, but the event date could be in the future. People will have a harder time trying to find information about the event if they cannot find it through google? (I'm that kind of person who may have registered for an event, it might be somewhere in my email, but I will google it anyway.. plus the Info page might have updated information) edit: "When Googlebot next crawls that page and see the tag or header, Googlebot will drop that page entirely from Google Search results, regardless of whether other sites link to it." ref |
Hi Mathieu, good point. I changed the PR to only use NOINDEX for
|
I just added the location mapping because I believe this should also respect the non-public setting and exclude past events for being indexed by google. |
CRM/Contact/Form/Task/Map/Event.php
Outdated
$startDate = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Event', $ids, 'start_date'); | ||
$is_public = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Event', $ids, 'is_public'); | ||
if ($is_public == 0 OR $startDate < $today) { | ||
CRM_Utils_System::addHTMLHead('<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we create a function addNoFollowHead or similar - I feel like we might get a situation where the preferrred meta for no-follow changes & it would be good to only change in one place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 for this idea. Grepping shows there are 4 other spots in the codebase already containing this line, so refactoring them into a function makes sense.
regarding past events - based on end date makes more sense I think. A course that has started but not ended might make sense to index (I'm a bit torn on doing this in core rather than an extension TBH - I feel like not public is clear cut but the past events feels like there could be use cases that differ. However, if they are past the end date it's probably ok - although I still search for past civicons :-) |
I agree with most people here that past events should be indexed but private events should not. |
8cd2235
to
c6d4092
Compare
I can live with that, I adjusted the commit and merged into one. |
Overview
This patch makes sure the Event Info page gets the NOINDEX metatag in order for Search Engines to NOT index the page when the event is
either in the past ornon-public.Before
Even when an event was
closed (past event) ornon-public it would still be indexed by google and other search engines.After
With this patch the Event Info and the corresponding Map page page gets the NOINDEX,NOFOLLOW metatag
Technical Details
The NOINDEX,NOFOLLOW gets inserted into head when either the event is:
2. past eventsComments
This patch will not remove old event page info listings from google, but a ligitimate site owner can remove them using the Google Search Console. With the NOINDEX tag in place they will not be reindexed.