All the ajax calls in the frontend are made by the default URL /wp-admin/admin-ajax.php. This URL is also used by hackers to upload viruses and scripts on your website.
Changing the wp-admin/admin-ajax.php URL is mandatory for protecting the WordPress site from hackers.
To easily change the admin-ajax.php path, use the WP Ghost plugin. After adding a new Ajax URL, the default admin-ajax.php URL will be hidden from hackers.
How to Change admin-ajax in WordPress
- To change the admin-ajax.php path, go to WP Ghost > Change Paths > Ajax Security section.
- Switch on the Hide wp-admin from ajax URL option to hide the wp-admin path from Ajax calls.

Read More: Change admin-ajax.php Path with WP Ghost