I don’t think that disabling admin-post.php is a good idea. Such solution may break WP, some plugins and themes.
But there is another, much simpler solution. Just add your action for admin_post (without nopriv) and process it properly – so if it’s a login action and user is already logged in, redirect him to proper url…
Related Posts:
- “Too many redirects” ONLY when trying to access wp-admin page
- Admin Page Redirect
- Unable to login and wp-login.php redirects to wp-admin%2F&reauth=1?
- Wrong canonical link on wp-admin pages
- stop redirection on /wp-admin call to /wp-login
- wp-admin produces a 302 redirect to itself
- How to remove items from +New admin menu?
- Users are redirected to homepage instead of wp-admin
- How to show an error message after publishing a post?
- Restrict access to admin but allow admin_post hook
- Unwanted redirect in admin area
- Login to wp-admin “redirect_to” points to wrong URL after migration
- How to get the password and username of the add new user form (admin back end) in wordpress
- wp-login.php — redirect logged in users to custom URL
- Can’t access wp-admin Internal Server Error 500
- Can’t access admin dashboard with wp-admin without /index.php after it
- Adding body class to login page?
- Change Dashboard url
- WordPress subdomain wp-admin redirects to main domain
- How to change how long items are kept in the trash?
- Admin first hook that outputs HTML?
- Display $pagenow error notice on all admin pages
- Can I edit the wp_post > post_content right before its inserted/updated?
- Why is there an intermediate redirect to https://public-url.org/wp-admin?
- Prevent /wp-admin/ from redirecting to homepage?
- How to check if upload window came from the featured image link?
- https://mydomain/wp-admin redirects to wp-login.php?redirect_to=https%3A%2F%2Fmydomain%2Fwp-admin%2F&reauth=1
- Redirect non-admin users away from wp-admin/index.php (main dashboard page) to wp-admin/profile.php
- WordPress (behind HAProxy and Jetty), not multisite, in sub folder – and /en/wp-admin/ keeps redirecting to /wp-admin/
- Created a new subdomain with same content. Should I add a redirect in my old subdomain?
- wp-admin – 404 after custom login form
- How to fix ‘WordPress redirection loop problem in wp-login.php page’?
- is_admin() not working when updating a post in the admin panel
- wp-admin 302 redirects
- Too many redirects after added SSL redirect on port 80 virtual host
- Can I hook into wp_update_core outside of the admin?
- ‘wp’ hook supposed to trigger when editing a post?
- Can’t access wp-admin, redirects to http://%24domain/wp-admin/
- Unable to properly login
- How do I add something to the “Edit Tag” page in wp-admin?
- Redirect an entire WordPress site on a subdomain, except wp-admin
- Admin sometimes redirects to HTTPS
- Too Many Redirects – WP-Admin Only
- WP Admin Login keeps redirecting to login
- CPU overload spam – redirect link to wp-admin and new post
- How to access wp-admin from original website after setting the domain redirect/forwarding
- Add HTML to custom post type edit page
- admin_post_nopriv_{$action} is secure?
- WordPress /wp-admin redirect to wrong port in docker
- Login redirect_to url is pointing to a url with the port
- Redirect from wp-admin back to page
- Can’t access WP-Admin via HTTPS
- Wp-admin Redirection loop after moving to subdirectory
- Trying to login to my site redirects me to the first page
- Avoid executing a function (redirect) if I’m in the admin area
- stop customize.php redirect to login page if admin is not logged in
- wp-admin redirects to standard wordpress page
- I cannot go to http://novathon.cloud.reply.eu/wp-admin – always redirected to /wp-login
- Unable to log in as admin
- Random HTTPs redirections at admin area in shared hosting
- How can visitors redirect wp-admin to the homepage?
- plugin: ‘init’ hook, check if we’re not in admin
- Why when I click on a link into the WP admin panel I am redirected to a link that doesn’t contains wp-admin prefix, so I obtain 404 error
- Word press wp-admin redirecting to reauth=1
- Wildcard multisite wp-admin url wrongfully redirected
- How to prevent a user from updating other users in WordPress?
- adding the category to the admin column for a custom post type?
- Change page title in admin area
- How to filter by post-format in admin?
- Make fonts.com font work in TinyMCE (iframe referrer issue)
- Securing wp-admin folder – Purpose? Importance?
- Opening specific posts on WP takes lot of time and freezes the editor
- How to load a CSS file into WordPress admin area using Child Theme? [closed]
- Getting “Cannot modify header information – headers already sent” error, but only on backend
- How to add wordpress blog to Windows 2008 R2 site
- Admin table list API?
- How to change user admin_color with WP CLI?
- WP Admin/ WP Login Redirect to themselves
- Unable to log in to localhost wp-admin page on XAMPP server
- Missing ‘Move to Trash’ option from bulk select box
- Force HTTPS 301 redirect with hook
- get_current_screen and the WP_Screen class
- Disable or lock parent pages from being edited in wordpress admin
- How login is possible, if I deny login page via .htaccess with allow ip
- Unable to display WordPress admin bar in the frontend as an admin
- View all comments on post one click
- I can’t access my wp admin dashboard
- How to logout the current user without notices and warnings?
- Updated to wordpress 5.5.1 doesn’t work
- How can I change block editors suggested links to display another url (i.e. from api.mysite to www.mysite)
- How to change labels in the projects page
- Failed to load resource: the server responded with a status of 431 ()
- Why WordPress not logout after I have close my browser?
- Images on admin backend not showing up
- Launch wordpress site to local computer from live website backed-up
- wp-admin won’t “remember me” in Chrome & Firefox
- Override WordPress Core File?
- WordPress Users page missing user count next to different types of users
- Removing /wp in Permalink URL of subdomain led to inaccessibility to WP Dashboard
- Creating an custom admin page from scratch