Title: [Plugin: Events Manager] 404 errors on upgrade
Last modified: August 19, 2016

---

# [Plugin: Events Manager] 404 errors on upgrade

 *  Resolved [illusiodesign](https://wordpress.org/support/users/illusiodesign/)
 * (@illusiodesign)
 * [15 years ago](https://wordpress.org/support/topic/404-errors-on-upgrade/)
 * Looks like the 404 error is a permalinks issue. When I specify a custom structure,
   the links to the events posts become broken. However, when leaving the setting
   to default, everything works fine.

Viewing 15 replies - 1 through 15 (of 42 total)

1 [2](https://wordpress.org/support/topic/404-errors-on-upgrade/page/2/?output_format=md)
[3](https://wordpress.org/support/topic/404-errors-on-upgrade/page/3/?output_format=md)
[→](https://wordpress.org/support/topic/404-errors-on-upgrade/page/2/?output_format=md)

 *  Plugin Author [Marcus (aka @msykes)](https://wordpress.org/support/users/netweblogic/)
 * (@netweblogic)
 * [15 years ago](https://wordpress.org/support/topic/404-errors-on-upgrade/#post-2073325)
 * hi, i tested it just now with /%category%/%postname%/ but no problems for me.
 * one common issue is that the events page hasn’t been selected from Events > Settings
   > Events Page. Just thought of another thing, did you try to de/reactivate the
   plugin?
 *  Thread Starter [illusiodesign](https://wordpress.org/support/users/illusiodesign/)
 * (@illusiodesign)
 * [15 years ago](https://wordpress.org/support/topic/404-errors-on-upgrade/#post-2073333)
 * Yes, I tried deactivating and uninstalling the plugin and clearing the database
   entries. I reverted to the 3.0.98 version as recommended by Dave on the support
   forum and everything appears to be working fine.
 *  Plugin Author [eventsmanager](https://wordpress.org/support/users/eventsmanager/)
 * (@eventsmanager)
 * [15 years ago](https://wordpress.org/support/topic/404-errors-on-upgrade/#post-2073345)
 * i misread your post a little, thought you meant custom permalink structures, 
   i think u mean turning it on or off? if its not working with permalinks it’s 
   probably because things didn’t update properly (see plugin site, recent post 
   with update waltkthrough.
 *  [Curtiss Grymala](https://wordpress.org/support/users/cgrymala/)
 * (@cgrymala)
 * [15 years ago](https://wordpress.org/support/topic/404-errors-on-upgrade/#post-2073377)
 * I followed the upgrade walkthrough completely, and experienced the exact same
   issue. All of the permalinks to my events stopped working when I updated to 4.0.2;
   leading to a 404 page, instead.
 * I believe I found the cause of the issue and I found a temporary work-around.
 * In my case, my “events” page was 3 levels deep in my site structure. I have a
   News Room page, which has an “Events” page as a child, then has my “Event Details”
   page (which is the page I have set as my events page in the Events Manager plugin
   settings) as a child of that.
 * When I moved the “Event Details” page to the top of the site structure (so it
   doesn’t have any parent pages), the permalinks started working properly.
 * EDIT – I just updated to 4.0.3 and the issue still exists. I also tried testing
   with my “Event Details” page as a 2nd-level page; and the 404 errors persisted.
   The only way the permalinks seem to work is if the “Events” page is a top-level
   page on the site.
 *  Plugin Author [Marcus (aka @msykes)](https://wordpress.org/support/users/netweblogic/)
 * (@netweblogic)
 * [15 years ago](https://wordpress.org/support/topic/404-errors-on-upgrade/#post-2073378)
 * nicely spotted. I’m able to duplicate the error. Will try to fix this asap.
 *  Plugin Author [Marcus (aka @msykes)](https://wordpress.org/support/users/netweblogic/)
 * (@netweblogic)
 * [15 years ago](https://wordpress.org/support/topic/404-errors-on-upgrade/#post-2073379)
 * think i got it. does this work:
 * replace classes/em-permalinks.php line 122 with:
 *     ```
       $events_slug = str_replace(trailingslashit(get_bloginfo('wpurl')),'', get_permalink($events_page->ID));
       				$events_slug = preg_replace('/\/$/','',$events_slug);
       ```
   
 * and resave your custom permalink structure (normal wp settings) to trigger the
   permalink rule flush
 *  Thread Starter [illusiodesign](https://wordpress.org/support/users/illusiodesign/)
 * (@illusiodesign)
 * [15 years ago](https://wordpress.org/support/topic/404-errors-on-upgrade/#post-2073390)
 * Moving the page to be at parent level resolved the issue. However, that’s not
   going to work for people who need to have the page as a child.
 * Marcus, did you mean line 243?
 *  Plugin Author [Marcus (aka @msykes)](https://wordpress.org/support/users/netweblogic/)
 * (@netweblogic)
 * [15 years ago](https://wordpress.org/support/topic/404-errors-on-upgrade/#post-2073417)
 * nope, 122 should solve the issue with child levels. should make it into a version
   within a day or two
 *  [Dave Hammond](https://wordpress.org/support/users/dave-hammond/)
 * (@dave-hammond)
 * [15 years ago](https://wordpress.org/support/topic/404-errors-on-upgrade/#post-2073459)
 * Could someone tell me how I work out which is line 122?
 * I tried the edit mentioned above and crashed the entire site. I’d like another
   go but I’m not sure how to know I’m replace the correct line. (122)
 * Dave
 *  [Curtiss Grymala](https://wordpress.org/support/users/cgrymala/)
 * (@cgrymala)
 * [15 years ago](https://wordpress.org/support/topic/404-errors-on-upgrade/#post-2073463)
 * Dave – Marcus was saying to find the following line in your events-manager/classes/
   em-permalinks.php folder:
 *     ```
       $events_slug = $events_page->post_name;
       ```
   
 * and replace it with the code he provided above.
 * Marcus – I just tried it, and still can’t seem to get it to work. I tested with
   my “Events” page as a 3rd-level page and as a 2nd-level page; I refreshed my 
   permalinks, etc.; and I’m still getting 404 errors for my events when the “Events”
   page is not a top-level page on the site.
 *  [Dave Hammond](https://wordpress.org/support/users/dave-hammond/)
 * (@dave-hammond)
 * [15 years ago](https://wordpress.org/support/topic/404-errors-on-upgrade/#post-2073464)
 * Thanks Curtiss. Still couldn’t get that to work. I ended up using an ftp solution
   and switched out the classes/em-permalinks.php with a new one EM team sent me.
   it works now but there are still a few bugs i’m working on. 4:20 am here, going
   to sleep and work on it tomorrow.
 * Dave
 *  Plugin Author [Marcus (aka @msykes)](https://wordpress.org/support/users/netweblogic/)
 * (@netweblogic)
 * [15 years ago](https://wordpress.org/support/topic/404-errors-on-upgrade/#post-2073466)
 * Hey Curtiss, does 4.0.4 fix it? It fixes it for a lot or ppl inc. Dave (and all
   my tests) I made a vid (on the plugin site, latest post)
 * If not, take a look at the /em-events.php file and around line 14, you’ll see
   some commmented code.
 * if you move the /* to just above the line with
    `echo "<h2>WP_QUERY</h2>";`
 * and check your events list. if you can send me the output of that and and details
   about your structure (or screenshots) that’d help. you can post it to the contact
   form on the site
 *  [Curtiss Grymala](https://wordpress.org/support/users/cgrymala/)
 * (@cgrymala)
 * [14 years, 12 months ago](https://wordpress.org/support/topic/404-errors-on-upgrade/#post-2073480)
 * I will update this evening and try it out. I’ll let you know either way. Thanks
   for your quick response.
 *  [Curtiss Grymala](https://wordpress.org/support/users/cgrymala/)
 * (@cgrymala)
 * [14 years, 12 months ago](https://wordpress.org/support/topic/404-errors-on-upgrade/#post-2073484)
 * Sadly, 4.0.4 actually seemed to break the event permalinks altogether for me (
   whether it’s a top-level page or not). I reverted to 4.0.3 for now.
 * I have submitted the output from on your contact form. Thanks.
 *  Plugin Author [Marcus (aka @msykes)](https://wordpress.org/support/users/netweblogic/)
 * (@netweblogic)
 * [14 years, 12 months ago](https://wordpress.org/support/topic/404-errors-on-upgrade/#post-2073486)
 * ok, working with Curtiss to try and fix this. note that this issue is limited
   to a certain spectrum of users, and I’ve not managed to pin it on one specific
   cause now.
 * I’ve noticed two patterns that others could comment on if similar on theirs:
    1. does your permalink structure start with index.php/…
    2. your wp-admin, wp-content, etc. files are not all in one folder
    3. windows servers maybe, possibly IIS (wamp is ok)?

Viewing 15 replies - 1 through 15 (of 42 total)

1 [2](https://wordpress.org/support/topic/404-errors-on-upgrade/page/2/?output_format=md)
[3](https://wordpress.org/support/topic/404-errors-on-upgrade/page/3/?output_format=md)
[→](https://wordpress.org/support/topic/404-errors-on-upgrade/page/2/?output_format=md)

The topic ‘[Plugin: Events Manager] 404 errors on upgrade’ is closed to new replies.

 * ![](https://ps.w.org/events-manager/assets/icon-256x256.png?rev=1039078)
 * [Events Manager - Calendar, Bookings, Tickets, and more!](https://wordpress.org/plugins/events-manager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/events-manager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/events-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/events-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/events-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/events-manager/reviews/)

 * 42 replies
 * 14 participants
 * Last reply from: [Marcus (aka @msykes)](https://wordpress.org/support/users/netweblogic/)
 * Last activity: [14 years, 1 month ago](https://wordpress.org/support/topic/404-errors-on-upgrade/page/3/#post-2073640)
 * Status: resolved