Posted: July 25, 2022 at 7:38 pm
Hello – From time to time, we experience 404 errors on our event pages. I have seen other posts regarding this issue. We go to Dashboard -> Settings -> Permalinks and hit save and that clears up the issue but its not ideal as this issue seems to happen a couple of times a month. How can we determine what is causing the issue?
Are you comfortable with PHP?
I have a snippet which hooks into the call to flush permalinks and makes a log of them here:
It also logs the stack trace to see ‘what’ is calling the function and when.
So you ad that snippet to a custom functions plugin on your site, we have some documentation on creating one here:
Then when it happens next, check the log files for ‘EE-Check’ and see when its false, then view the stack trace to see what function/plugin called the flush and when. Or post it here for us to view and see if we can help.
Note – the above may well add a lot of log entries into your error logs, it shouldn’t be an issue but something you should be aware of.
HI Tony – I was able to follow your instructions and added the php code.
We have had the issue again where our event pages turned to 404’s. I’ve been looking for the “log files for ‘EE-Check’ but I am unable to locate them. can you provide more details on where I should be seeing the logs? I’ve checked via sFTP inside the wp-content folder.
They should show up in your PHP error logs, usually a file called
If not, you can add this snippet to your wp-config.php file:
Right now you’ll have something like:
within that file, and the above snippet replaces that single line.
What that will do is tell your site to store any errors in