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
- Change page title in admin area
- Is it possible to set a option, and then redirect to another page directly from a admin notice link?
- 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
- Redirect loop (only for multisite network admin)
- Cookie value cannot be read until I’ve logged into the WP admin
- What corrections does this code need?
- Can’t access login screen, wp-login.php 404’s
- Distinguish profile user and admin user IDs / get ID of user being edited
- How to add wordpress blog to Windows 2008 R2 site
- WordPress disable ‘Install Themes’ tab
- WordPress Admin Not Loading All Core Scripts
- Admin table list API?
- How to change user admin_color with WP CLI?
- How to apply a CSS file to my admin pages?
- 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
- Why am I locked out of the system?
- Admin post list – adding an option to the date filter dropdown
- Disable the “remember me” to wp-admin
- How to Restrict Access to all wp-admin pages for subscriber users
- Why is WordPress enqueuing admin relevant scripts (e.g., React, ReactDOM, Redux, hooks, TinyMCE etc) when not logged in?
- How to add custom CSS and JavaScript file for wp- admin dashboard (backend)
- GoDaddy hosting wp-admin problem
- WordPress Migration Post Problems
- wp-admin and wp-login.php not Accessible after Cloudflare
- Strange URLs admin area bug
- mysql_escape_string PROBLEM
- Cannot access my wordpress website
- Custom comment action
- Added fields in quick edit screen need to update at the moment
- Modify admin panel tab position
- not able to add thumbnail custom field in dropdown
- No wp-admin, wp-config, or .htaccess folder/file
- wordpress admin is broken [closed]
- Extend user search in the Wp backend area on the users.php page to allow for searching by email domain and role from the “users search” input box