Hello @unknownman888,
Thank you for contacting support.
When that happens are you able to fix it by flushing the permalinks? If that’s the case it seems that the permalinks on the website are not sticking and you could implement a simple code snippet to flush them on a consistent basis.
Here’s an example of that code:
add_action('my_hourly_event', 'do_this_hourly');
functionmy_activation() {
if( !wp_next_scheduled( 'my_hourly_event') ) {
wp_schedule_event(time(), 'hourly', 'my_hourly_event');
}
}
add_action('wp', 'my_activation');
functiondo_this_hourly() {
global$wp_rewrite;
$wp_rewrite->flush_rules();
}
Don’t hesitate to get in touch if you have any other questions.
Thread Starter
Unknown
(@unknownman888)
The only way I fixed it was disabling the option then turning it back on. Flushing cache, disabling wprocket, and flushing cache on cloudflare didn’t work. I have had it happen about 3-4 times.
Hello @unknownman888,
In that case, please head over to your WordPress dashboard > Settings > Permalinks and save the settings without changing anything.
You may also try implementing the code that we shared previously. You may refer to this guide on how to add filters to your website: https://rankmath.com/kb/wordpress-hooks-actions-filters/
If that doesn’t work, please ask your hosting provider to increase the limits of these values to the one listed below:
PHP Memory Limit: 512M
Max input time: 150
PHP time limit: 120
PHP max input variables: 1000
Looking forward to helping you.
Thread Starter
Unknown
(@unknownman888)
I tried saving the permalinks already before posting.The limits are also high enough.
Hello @unknownman888,
Can you please confirm if you have added the code we shared here: https://ww.wp.xz.cn/support/topic/remove-category-base-2/#post-16370472
Looking forward to helping you.
Thread Starter
Unknown
(@unknownman888)
You keep marking as resolved when not resolved. Yes I added the code but don’t really want to try again on my live site. I wanted the issue to be known so it can be fixed. I may try it again sometime in the future.
Hello @unknownman888,
If this is happening on a staging website you can add the code there and test for a couple of days and see if that helps solve the issue.
In case it helps, you can then add the same on the live website.
Thank you.
Hello,
Assuming you are using the latest version of all the plugins, themes & WordPress and the issue is resolved, we are closing this support topic.
If that is not the case, feel free to open a new support topic or reply to this one, and we will be more than happy to assist.
Looking forward to helping you. Thank you.
Hi there,
I just experienced the same issue. When I toggled on the “remove category base” my permalink structure (only for my product categories) all messed up. I tried:
- Deactivating my plugins (including RankMath)
- Purging my caches – both from frontend and backend
- Toggling off and then on again for “remove category base”
Only item 3 worked. However, I cannot go back to having category base enabled anymore if I wanted as it will continuously throw a 404 error.
Hello @user575757,
Please try the code we mentioned here to flush the permalinks on a consistent basis: https://ww.wp.xz.cn/support/topic/remove-category-base-2/#post-16370472
Hope this helps.
Don’t hesitate to get in touch if you have any other questions.