Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Use alternative ajax request to admin-ajax.php
This topic contains 4 replies, has 2 voices, and was last updated by pbpyrojust18 2 years, 4 months ago.
- AuthorPosts
- January 13, 2021 at 1:14 am #31105
Is it possible to use an alternative ajax url instead of
/wp-admin/admin-ajax.php
? Thebackend_ajaxurl
for ASP is/wp-admin/admin-ajax.php
. Can I change that? It is fine for our development environments, but when we deploy to our QA and PROD environments which are on www domains we block any access or requests to/wp-admin/
for security reasons. Is there a php hook, snippet, or anything I can do with ASP to change thebackend_ajaxurl
? Or point me to some docs for some help? I’ve been looking into some ways to do, but I wanted to reach our to you first. Thanks.January 13, 2021 at 3:08 pm #31120Hi,
I would not recommend doing that whatsoever, as the ajax URL is a wordpress core feature – all the plugins, as well as the wordpress core is using that. Unfortunately I don’t know if that is possible to change securely, I would not recommend moving that file though, or blocking public access from it. You could maybe try blokcing the rest of the folder, and make an exception to it somehow.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
January 14, 2021 at 1:59 am #31127Thanks for that info. Is it at least possible to create a WordPress hook to change the value of
"admin_url" => admin_url(),
or make it relative so it doesn’t use an absolute URL?January 14, 2021 at 11:59 am #31131I guess there is a hook somewhere. Check the source of the get_admin_url, there might be something there. But again, I really don’t recommend tempering with these URIs if possible.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
January 14, 2021 at 6:15 pm #31145I fixed the issue we were having. It was a CORS Policy cross domain issue. No need to try to hack something together. Everything is working correctly now. Thanks for your info.
- AuthorPosts
You must be logged in to reply to this topic.