No, it’s not possible if you want to follow the best practice, and neither you need and should do it.
When you make an AJAX call, some parts or WordPress’s core will be loaded based on the AJAX type (whether it’s admin-Ajax or REST-API). It is vital for this to happen, since some scripts demand on using core functions such as get_the_ID()
.
Your theme’s functions.php
file is going to be loaded in this process. If your file runs some functions by itself, then you probably have to optimize your functions.php
, since this should not usually happen, and the functions should be run only when necessary.
Related Posts:
- Do I require the use of nonce?
- simple wordpress ajax plugin not working when not logged in
- Problem with WordPress Ajax form
- How to set a custom path, for ajax image upload folder in admin?
- admin-ajax.php responding with 0
- Page Reloads Before AJAX Request Finishes
- wp_insert_post() is returning the correct post ID, no failure, but the post content does not get updated
- How to test nonce with AJAX – Plugin development
- Create onClick Event to Re-load a Widget
- WordPress ajax doesn’t display object method on jQuery .change() function
- adjust section according to country?
- How to send Ajax request from my plugin in admin dashboard?
- AJAX success response is not working but it’s saving my changes
- how to update and display an option without reloading the page
- Using data sent via AJAX in multiple functions on a WP plugin
- Problem with AJAX in wordpress plugin
- Any ideas why I am getting “I’m getting “wp-admin/admin-ajax.php 401 (Unauthorized)”
- Execute Jquery when a specific page in my plugin is loading
- PHP: How to access db the right way in plugin?
- calling admin-ajax.php from admin-ajax.php
- Submit form to db
- How to use wp_send_json() and output the value with ajax?
- Ajax on the Administration Side of plugin – wp_localize_script – how to pass value from JQuery to PHP function in class?
- Is it possible to access admin-ajax.php using PHP?
- Settings API form – submit with AJAX
- Post form – AJAX won’t upload featured image – Plugin development
- How can I get my WordPress plugin to receive data and relay it in an ajax/php request to a remote server that requires authentication?
- Submit remote form to wordpress REST API and save data to custom post type
- custom mailchimp form using HTTP API
- 400 bad request admin-ajax file upload
- Input field duplicates on form submit by jQuery
- Ajax in a class instantiated via shortcode
- defined (‘ABSPATH’) false after AJAX post to other PHP-file
- Cookie not created in AJAX request
- How to pass and validate nonce in custom REST routes
- getJSON response to PHP
- ajax problems on loading page [closed]
- Looking for a better way to handle an ajax script that pulls in post data on click
- Ajax call doesn’t work in frontend but it’s working in backend (when I’m logged in)
- How to add default images into theme customizer image control?
- wordpress custom endpoint multiple params
- Debugging PHP object during Ajax call in WordPress
- Access/update database with jQuery
- Passing jQuery value using Ajax to a page template
- Why is this Ajax not working?
- Insert array data on plugin activation
- Adding Default Settings to Theme My Login plugin
- How to make drop down post title
- ajax, right way to do it and make it works?
- Hide categories that are not used in the post type
- Automated Cart Update With Alert Box Each Time
- filter default query to show just selected level of child pages in wordpress
- Call a PHP Function with Multiple Parameters that is outside the AJAX Handler
- How to make my custom widget appear within WordPress widgets? Plugin development
- WordPress, AJAX and pre_get_posts using conditional tags
- Adding widgets to my plugin page instead of WordPress dashboard
- How to insert data into database using wp cron job
- Refresh table data with Ajax
- Font Awesome changing default WordPress Font
- Download full html page with CSV export plugin
- unable to use ‘new WP_Query’ in AJAX call
- admin-ajax Firing Error 400 When Logged In
- Woocommerce with Lazy Load php and ajax
- how to save checkbox data for custom setting?
- Can I make get_users() query global?
- How to Schedule Cronjobs for start of every month and year
- My jQuery Ajax form submit is still refreshing page?
- Submitting a form, using Ajax, to run a SQL Select query based on user input from the form
- WordPress WP_Query without query GET parameters
- Where to copy woocommerce files to in my custom theme to avoid editing the core plugin?
- How can I get plugin meta data without knowing the plugin folder?
- Flatten Responses returned via WP REST API via WP_Error for obfuscation
- WordPress Custom Add To Cart Button with AJAX
- How does add_option() function enable action hooks to fire right after actiavtion?
- WordPress cascading dropdown selection search based on Parent Page & Child Page
- Create plugin with custom page and template caused an error `Call to undefined function get_header()`
- jquery & ajax getting data from php in wordpress . admin-ajax.php returns 400
- register_block_type is not working properly
- WooCommerce REST API AJAX Auth – 401 response
- In a foreach loop, how can I add a meta value if it doesn’t exist?
- Looping through and combining calls to Woocommerce REST API
- Should I use wp_cache in my plugin to make it faster?
- How to import woocommerce custom fields data into another site?
- AJAX numerical pagination problem in TwentyFifteen-child theme
- When I create a new custom post type, it replaces the old post type
- Why my Ajax events are no longer detected after dynamic change of shortcode content
- Woocommerce variable products are being added to the card on the homepage (ajax)
- global $post inside plugin query messes up every new post page in wp-admin
- wp_query (or hook) posts by date (id) in array then set post_type
- Chosen Select jquery Not Working in Plugin
- Submitting my form to the database and then redirecting to payment site
- Pass the updated value of aid from form using ajax
- I’m not able to get access $wpdb in my php file in wordpress
- How do I change the Go To Categories link in the term_updated_messages
- Query posts by custom taxonomy slug in WP REST API?
- oneOf JSON Schema validation not properly working for custom post meta value?
- Too few arguments at registering new templates in my plugin
- Remove Woocommerce product from cart with ajax/fetch
- I want to lists posts in wordpress to nearest location entered by the user
- WooCommerce Modal Fly cart on add to cart – With AJAX