Use “name” query string to refer to form field instead of pagename
When handling form submissions, it would generally be advisable to POST your form to a custom AJAX handler or wp-admin/admin-post.php form handler. If an external API integration requires you to accept the name parameter, setting up this functionality as a REST API endpoint or controller would give you fairly complete control over the query vars. … Read more