Home › Forums › Calendar Products › Events Calendar PRO › 404 Errors on Single Day Event Pages
- This topic has 6 replies, 3 voices, and was last updated 9 years, 1 month ago by Geoff.
-
AuthorPosts
-
March 4, 2015 at 9:57 am #945951BrianParticipant
Hello –
I can’t resolve 404 errors that appear in Google Webmaster Tools which are generated by the Events Calendar Pro Plugin – they appear to happen on single day event pages where no events are present.
I’ve followed the troubleshooting steps outlined here (https://theeventscalendar.com/knowledgebase/fixing-http-404-errors/) and have inserted the recommended function into my functions.php file (https://gist.github.com/elimn/877bc90421526d22900b). When I run a single event page URL through a checker, like http://www.webconfs.com/http-header-check.php it still shows an HTTP header of 404/Not Found.
Here’s the debug output from one of the events pages:
<Tribe Events Query>
object(WP_Query)#124 (51) {
[“query_vars”]=>
array(53) {
[“post_type”]=>
string(12) “tribe_events”
[“eventDisplay”]=>
string(3) “day”
[“eventDate”]=>
string(10) “2012-11-12”
[“error”]=>
string(0) “”
[“m”]=>
string(0) “”
[“p”]=>
int(0)
[“post_parent”]=>
string(0) “”
[“subpost”]=>
string(0) “”
[“subpost_id”]=>
string(0) “”
[“attachment”]=>
string(0) “”
[“attachment_id”]=>
int(0)
[“name”]=>
string(0) “”
[“static”]=>
string(0) “”
[“pagename”]=>
string(0) “”
[“page_id”]=>
int(0)
[“second”]=>
string(0) “”
[“minute”]=>
string(0) “”
[“hour”]=>
string(0) “”
[“day”]=>
int(0)
[“monthnum”]=>
int(0)
[“year”]=>
int(0)
[“w”]=>
int(0)
[“category_name”]=>
string(0) “”
[“tag”]=>
string(0) “”
[“cat”]=>
string(0) “”
[“tag_id”]=>
string(0) “”
[“author”]=>
string(0) “”
[“author_name”]=>
string(0) “”
[“feed”]=>
string(0) “”
[“tb”]=>
string(0) “”
[“paged”]=>
int(0)
[“comments_popup”]=>
string(0) “”
[“meta_key”]=>
string(0) “”
[“meta_value”]=>
string(0) “”
[“preview”]=>
string(0) “”
[“s”]=>
string(0) “”
[“sentence”]=>
string(0) “”
[“fields”]=>
string(0) “”
[“menu_order”]=>
string(0) “”
[“category__in”]=>
array(0) {
}
[“category__not_in”]=>
array(0) {
}
[“category__and”]=>
array(0) {
}
[“post__in”]=>
array(0) {
}
[“post__not_in”]=>
array(0) {
}
[“tag__in”]=>
array(0) {
}
[“tag__not_in”]=>
array(0) {
}
[“tag__and”]=>
array(0) {
}
[“tag_slug__in”]=>
array(0) {
}
[“tag_slug__and”]=>
array(0) {
}
[“post_parent__in”]=>
array(0) {
}
[“post_parent__not_in”]=>
array(0) {
}
[“author__in”]=>
array(0) {
}
[“author__not_in”]=>
array(0) {
}
}
[“tax_query”]=>
object(WP_Tax_Query)#352 (6) {
[“queries”]=>
array(0) {
}
[“relation”]=>
string(3) “AND”
[“table_aliases”:protected]=>
array(0) {
}
[“queried_terms”]=>
array(0) {
}
[“primary_table”]=>
NULL
[“primary_id_column”]=>
NULL
}
[“meta_query”]=>
bool(false)
[“date_query”]=>
bool(false)
[“post_count”]=>
int(0)
[“current_post”]=>
int(-1)
[“in_the_loop”]=>
bool(false)
[“comment_count”]=>
int(0)
[“current_comment”]=>
int(-1)
[“found_posts”]=>
int(0)
[“max_num_pages”]=>
int(0)
[“max_num_comment_pages”]=>
int(0)
[“is_single”]=>
bool(false)
[“is_preview”]=>
bool(false)
[“is_page”]=>
bool(false)
[“is_archive”]=>
bool(false)
[“is_date”]=>
bool(false)
[“is_year”]=>
bool(false)
[“is_month”]=>
bool(false)
[“is_day”]=>
bool(false)
[“is_time”]=>
bool(false)
[“is_author”]=>
bool(false)
[“is_category”]=>
bool(false)
[“is_tag”]=>
bool(false)
[“is_tax”]=>
bool(false)
[“is_search”]=>
bool(false)
[“is_feed”]=>
bool(false)
[“is_comment_feed”]=>
bool(false)
[“is_trackback”]=>
bool(false)
[“is_home”]=>
bool(false)
[“is_404”]=>
bool(false)
[“is_comments_popup”]=>
bool(false)
[“is_paged”]=>
bool(false)
[“is_admin”]=>
bool(false)
[“is_attachment”]=>
bool(false)
[“is_singular”]=>
bool(false)
[“is_robots”]=>
bool(false)
[“is_posts_page”]=>
bool(false)
[“is_post_type_archive”]=>
bool(false)
[“query_vars_hash”:”WP_Query”:private]=>
string(32) “aab7512d662450c2ba8eaa56dbcb5504”
[“query_vars_changed”:”WP_Query”:private]=>
bool(false)
[“thumbnails_cached”]=>
bool(false)
[“stopwords”:”WP_Query”:private]=>
NULL
[“query”]=>
array(3) {
[“post_type”]=>
string(12) “tribe_events”
[“eventDisplay”]=>
string(3) “day”
[“eventDate”]=>
string(10) “2012-11-12”
}
[“tribe_is_event”]=>
bool(true)
[“tribe_is_multi_posttype”]=>
bool(false)
[“tribe_is_event_category”]=>
bool(false)
[“tribe_is_event_venue”]=>
bool(false)
[“tribe_is_event_organizer”]=>
bool(false)
[“tribe_is_event_query”]=>
bool(true)
[“tribe_is_past”]=>
bool(false)
}
Query Results:
array(0) {
}
is_404() =
bool(false)
</Tribe Events Query>Thanks for any help…
BrianMarch 5, 2015 at 8:31 am #946183GeoffMemberHello there, Brian! Welcome to the forums and sorry for the issue here.
This is definitely something we’ve worked on in the past and is a continual evolution as far as how to properly resolve 404s from pulling on Day Views where there are no events.
First off, there is a third-party plugin called Event Rocket that has a method for resolving this. We don’t support the plugin here in the forums, but it does effectively solve the issue you refer to by targeting empty Day Views.
Another option is to follow the suggestions outlined in this thread.
I’m hoping that between these two solutions, one will get you what you’re looking for. 🙂
Cheers!
GeoffMarch 5, 2015 at 8:52 am #946194BrianParticipantHi Geoff –
I’ve tried the Event Rocket Plugin, the custom “single-day.php” template file outlined in that thread, and at least a half dozen custom functions added to the functions.php file – they all don’t seem to have any impact on the http header status of empty event pages.
Any other suggestions? The strange thing is, the page actually exists – it’s just says “No events scheduled for September 21, 2012. Please try another day” – I’m not sure why the header returns a 404.
From my research, it seems like every installation using The Events Calendar plugin – pro or otherwise – is impacted by this, and many other users are struggling with this issue. I’d appreciate it if your team could look into it further.
March 5, 2015 at 8:54 am #946196RobertParticipantI just discovered that with my Google Toolbar on, event views that have no events, such as day or week, I get a page not found error.
If I turn off the Google Toolbar (in IE), the event view shows but the breadcrumbs have:
Home / Page Not Found
I would venture a guess that the issue you have with Webmaster Tools is related.
March 5, 2015 at 8:59 am #946198BrianParticipantHi Robert –
The issue doesn’t appear to be browser/plugin related, it’s the HTTP header being returned by the server for these single-day event pages.
We’ve got multiple sites running the Events Calendar plugin, and they all have this issue. If you go to http://www.domain.com/events/2012-10-04/ (provided there is no event on that day) the header returns a 404. I’ve used this tool to verify: http://www.webconfs.com/http-header-check.php
March 5, 2015 at 12:40 pm #946264GeoffMemberHey Brian–thanks for following up!
The kicker here is that returning 404s on day views with no events is technically correct and how the plugin was designed to function. If no events are found, then a 404 status is returned.
One way around this, if you feel inclined to go this route, is to force a 200 status. Here’s a snippet that will do that. I want to caution, however, that it will force a returned 200 OK status for all event pages.
add_action( 'wp', 'no_event_404s' ); function no_event_404s() { if ( ! tribe_is_event_query() ) return; status_header( 200 ); }
Cheers!
GeoffMarch 23, 2015 at 8:19 am #950150GeoffMemberHi there, Brian! This thread’s been quiet for a while, so I’m going to go ahead and close it. Please feel free to start a new thread if any other questions pop up and we’d be happy to help. 🙂
Cheers!
Geoff -
AuthorPosts
- The topic ‘404 Errors on Single Day Event Pages’ is closed to new replies.