Posted: December 29, 2022 at 12:53 pm
Hi. Just suddenly today, all our event pages are coming up as 404. It was definitely working last night, and I have made no changes I am aware of. Calendar listings, other Event Espresso functions are working fine, but all event pages have disappeared. However, I can still edit the pages on the back end in WordPress, so they do exist somewhere in the ether. |
|
Hi there, This is usually caused by something flushing permalinks at an unexpected point before EE could add its rewrite rules. Go to Dashboard -> Settings -> Permalinks. Make no changes and just hit save. Does that fix it? |
|
Yes that worked. Thanks! |
|
You’re most welcome ๐ |
|
Going to Settings > Permalinks is a great, simple solution, and it works. But the event pages started throwing 404s again today (second time in a week), and I didn’t learn of the problem until 6 hours later from a frustrated customer. This is becoming more than a minor annoyance. Is there any way to stop this from occurring? Or at least predict when it might happen? |
|
Manually flushing permalinks as above isn’t intended as a ‘proper’ fix, but if another plugin randomly decides to flush permalinks early it fixes the problem which is great for a one-off. As you mentioned if that’s happening regularly then it’s not a solution. To fix this we need to narrow down what is calling to flush permalinks so we can check what that plugin (if it is indeed a plugin) is doing. The way I would do this is using a function like this: https://gist.github.com/Pebblo/a6d2b949d0ae784c09de442b9848ff7d#file-1tw_log_rewrite_rules_array-php You can add that to a custom functions plugin on your site, we have some documentation on creating one here: https://eventespresso.com/wiki/create-site-specific-plugin-wordpress-site/ It adds a log entry each time a your permalinks are flushed and also adds a stack trace of WHAT called the permalink flush so we can then know where to start looking. Add the above snippet to the site. Edit your site’s wp-config.php file and find:
Change that single line for this snippet: https://eventespresso.com/wiki/troubleshooting-checklist/#wpdebug Which tells WordPress to write the log entries in a location we can view them. Once thats been done go to Dashboard -> Settings -> Permalinks again and hit save to confirm log entries are working. Let me know when you’ve done that and I’ll check your site to see if the logs are there. Then it’s a case of waiting for it to happen again and reviewing the logs to find what flush permalinks to see if we can dig deeper from there. |
|
Thanks. I tried the last step, but I did not find
Since I’m not a coder, I didn’t want to attempt a guess and mess things up. Can you tell me how it should be edited? Thanks! |
|
Inside
The above snippet just got above that. Basically you need to enable WP_DEBUG, before this big of code:
Do not make changes within the |
|
Thanks! I followed all the steps in your email, flushed the permalinks again. Can you please check the logs and make sure it’s working? Thanks! |
|
I cant view the logs becuase access is blocked but they should be in We had another report of something similar which turned out to be the wp-login requests here: https://eventespresso.com/topic/events-disappearing-from-front-end-on-website/ They used this snippet: https://gist.github.com/Pebblo/fd47c19d038ec7b5ce0aa397ba2aacc4 So you could try adding that to the site and see if that stops it, if so it’s possibly the plugin/code causing it. |
|
Thank you. It happened 3 more times today and yesterday. I have the debug.log downloaded. How can I send it to you? Thank you! |
|
Send it to support[at]eventespresso.com and I’ll take a look |
|
Sent. Please let me know. |
|
Hi there, Your logs show the same as the other thread I linked to, the permalinks are being flushed on the login requests. Try adding the snippet I mentioned above HERE. You can add that to a custom functions plugin on your site, we have some documentation on creating one here: https://eventespresso.com/wiki/create-site-specific-plugin-wordpress-site/ Then see if that stops the issue. |
|
Thank you. I have added the snippet as a plugin. Hopefully that does the trick. Once I confirm this fixes it, should I delete the code I added above to generate the log file? |
|
Yes, to clarify, you mean the code from here: https://eventespresso.com/wiki/troubleshooting-checklist/#wpdebug If the above stops it from happening, remove that from |
|
Well, it hasn’t happened in 5 days now, so I think it worked. Thank you much Tony! I have removed the debug.log file and the code in wp-config.php. Connor |
|
Awesome, I’m glad that worked ๐ |
|
The support post ‘All event pages showing 404’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.