Home › Forums › Calendar Products › Events Calendar PRO › Remove Date & Time Schema for Specific Events
- This topic has 6 replies, 2 voices, and was last updated 6 years, 4 months ago by Anthony.
-
AuthorPosts
-
December 18, 2017 at 9:34 am #1407974AnthonyParticipant
I have implemented some code to allow me to have TBA listed for an event where we do not have a time and date determined yet.
The basic principle is that i set the date to 1900-01-01 for start and end, as well as set the time to midnight for start and end. At that point i can do if then statements in the template to swap out the time and date for TBA or any other text.The issue is that the schema for search engines still shows up on the page with the date and time of 1900-01-01 and midnight.
I am trying to figure out what file creates that schema so that i can either edit it and add an if then statement or figure out is there is a filter i can hook into to edit it through an action or filter hook from the functions.php so i don’t have to edit a core file.
December 19, 2017 at 6:25 am #1408676Jaime MarchwinskiKeymasterHi Anthony,
Thanks so much for reaching out!
The following forum posts have some more information about how search engines display your data and have some plugin suggestions for how to alter things:
- https://theeventscalendar.com/support/forums/topic/display-events-in-google-search/
- https://theeventscalendar.com/support/forums/topic/how-do-i-get-my-event-listing-data-to-show-up-on-google-search/
In addition, you may be interested in our Themer’s Guide, which can show you the different templates and views that are available to edit:
https://theeventscalendar.com/knowledgebase/themers-guide/
Let me know how it goes and if you have any other questions along the way!
Thanks,
Jaime
December 19, 2017 at 11:35 am #1409018AnthonyParticipantThank you for the information, however the plugin you recommend is only for “editing” the data being sent to google, and i need to disable the output.
I need to edit the file that actually creates the schema data, in the events calendar plugin, to be output to html so that i can add an “if/then” statement to the code in order to allow this specific event to have NO schema data for date and time AT ALL listed in the outputted html. I just don’t know which file that is, and the “themers guide” doesn’t list it because it’s a core file that needs to be edited, not a template file that can be moved to the child theme. Ideally if there is a hook that i can use to affect the function that creates the data output, that would be awesome, but since this feature request dates back to 2013, I assume its going to need to be a core file edit.
The only data google can see about this event currently IS in the LD+JSON script on the page as ALL other dates and times for the event have been changed to “TBA” in the html, so the only thing that google can pickup is this data that i need to disable.
December 19, 2017 at 12:31 pm #1409087AnthonyParticipantAlso,
I will gladly write the plugin code to do the work, I just need some information on how the Tribe__Events__JSON_LD__Event function or the tribe_json_ld_{type}_object filter is used in order to affect the output of the data.
Something along the lines of
$args = array( date=>'new date', time=>'new time'); apply_filters( "tribe_json_ld_{$type}_data", $data, $args );
so that it keeps the old data and just changes the date and time to be not what is initially listed…
December 20, 2017 at 4:55 am #1409639Jaime MarchwinskiKeymasterHi Anthony,
Just to let you know, we are limited by our Support Policy in how much we can help with customizations, but I will try to point you in the right direction.
Here is a function that you may be interested and some more information about it:
https://theeventscalendar.com/function/tribe_events_template_data/
You can also look through our functions archive here:
https://theeventscalendar.com/functions/
In addition, the following forum post contains a snippet that can disable JSON:
Let me know how that goes!
Thanks,
Jaime
January 11, 2018 at 8:35 am #1423550Support DroidKeymasterHey 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 ‘Remove Date & Time Schema for Specific Events’ is closed to new replies.