Posted: October 28, 2020 at 7:47 am
We have been experiencing what a lot of others have complained about. Our event pages were getting 404 error pages so we followed your suggestion and edited the event template to use a slug other than ‘events’. In our case that was changed to “hhw_events”. And that worked, for a while. Every few days the issue represents itself and we now have to go in and resave their permalink structure. Here are the steps that we do: – I loaded the page and got the 404 Error. Do you know what would cause this to keep happening?Is there anything we can do to make this a permanent fix so we don’t have to reset everything every few days? Thanks so much for your help! |
|
Hi there,
The only time you should need to change it to something other than You’ve already changed the permalinks now so keep using those, but just a note for future readers.
You likely only need the last step there to flush permalinks and have the posts work again.
Not from the info we have but are you comfortable with PHP and FTP? I can give you a snippet to add to your site (and you’ll need to make a change to In short the snippet will write a log entry each time your site flushes permalinks with a stack trace of the function that called it. So you add the snippet, enable WP_DEBUG_LOG on the site and then wait for it to happen again. When it does you fix the permalinks again and send over the log so we can investigate. Is that something you are comfortable with? |
|
Thanks Tony! I am certainly comfortable with that so if you send it over I can give it a try. Thanks so much for your help and quick reply! |
|
This snippet: https://gist.github.com/Pebblo/a6d2b949d0ae784c09de442b9848ff7d That in itself is a plugin but you can add the to a custom functions plugin if preferred, we have documentation on creating one here: https://eventespresso.com/wiki/create-site-specific-plugin-wordpress-site/ You’ll need to enabled WP_DEBUG and WP_DEBUG_LOG for this, we recommend using this code: https://eventespresso.com/wiki/troubleshooting-checklist/#wpdebug That’ll log the entries to |
|
Hi Tony, I believe I followed your directions properly but I see no debug file. Is there another place it might go or another way to access those logs? I can see the error log but not a debug log. Thanks! |
|
No, the above sets it up to log in So, starting from the beginning, the custom functions plugin you’ve created is installed and activated on the site, correct? (Check in Dashboard -> Plugins and confirm the plugin is activated and not just installed) You’ve added the code shown here: https://eventespresso.com/wiki/troubleshooting-checklist/#wpdebug In your Note that snippet needs to go before the line Like this: https://monosnap.com/file/TmFcsuI3goTOuyCxgPKYO1tn6NQdPr |
|
Hi Tony, Ok, I had put that below the line so hopefully we can wait for the error to present again and I will get the debug log for you. Thanks for the help! |
|
Ok, I’ve just checked the site to confirm the log worked and it does, however as your using different events slug from the default one you’ll need to edit line 29: To be:
The log still works without that change, but the EE-Check is a quick way to spot when the permalinks break. |
|
Hi Tony, Ok, I reviewed the log again and is this the error code you needed to further troubleshoot? [stacktrace] => #0 /home/ytjcqccof1xv/public_html/wp-includes/class-wp-hook.php(287): tw_log_rewrite_rules_array(Array) If not, what can I send you that will be useful? Thank you so much for your help! |
|
Ok so All In One SEO is calling flush permalinks on the wp-login request, we don’t run EE on that request so EE rules won’t be added. Try adding this snippet to your site: https://gist.github.com/Pebblo/fd47c19d038ec7b5ce0aa397ba2aacc4 Add it to your custom functions plugin and not your theme’s |
|
Thanks Tony! I will add that in and see if we run into any other problems in the next week or two! |
|
Fingers crossed 🙂 |
|
The support post ‘Event Slug 404 Error Page’ 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.