
Are you facing a 404 error when using the WP Frontend Delete Account or any other plugin or have you added a new endpoint in the WooCommerce account page?
This 404/ page not found/permalinks issue usually happens when a new permalink is added to your site. The front end of the page still doesn’t know the new permalink due to various reasons such as cache.
Fix 404 page not found
Here are two options to fix it. Interface way & programmatic way.
1) Flush the permalinks
Just go to the WordPress dashboard > Settings > Permalinks. You may do nothing and save. It will fix the permalinks issue.
2) Flush the permalinks (programmatic)
Use the following function.
flush_rewrite_rules();
Ideally, use it only when required because it’s a resource intensive. I do it only on the WP Frontend Delete Account settings page on admin_init
hook.
// Flush Permalinks.
if ( ! empty( $_GET['page'] ) && 'wp-frontend-delete-account' === $_GET['page'] ) {
flush_rewrite_rules();
}