Title: [Plugin: WordPress HTTPS (SSL)] WordPress HTTPS breaks AJAX calls to admin-ajax.php
Last modified: August 20, 2016

---

# [Plugin: WordPress HTTPS (SSL)] WordPress HTTPS breaks AJAX calls to admin-ajax.php

 *  Resolved [Marko-M](https://wordpress.org/support/users/marko-m/)
 * (@marko-m)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-wordpress-https-ssl-wordpress-https-breaks-ajax-calls-to-admin-ajaxphp/)
 * Hello,
    when HTTPS is activated only on backend all frontend AJAX calls to [WordPress preferred](http://codex.wordpress.org/AJAX_in_Plugins)
   AJAX callback handler wp-admin/admin-ajax.php fail due to browsers [Same origin policy](http://en.wikipedia.org/wiki/Same_origin_policy).
   This breaks many plugins for a lot of users. What can be done?
 * Thanks and regards,
    Marko
 * [http://wordpress.org/extend/plugins/wordpress-https/](http://wordpress.org/extend/plugins/wordpress-https/)

Viewing 5 replies - 1 through 5 (of 5 total)

 *  [Caspie](https://wordpress.org/support/users/caspie/)
 * (@caspie)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-wordpress-https-ssl-wordpress-https-breaks-ajax-calls-to-admin-ajaxphp/#post-3081547)
 * Well, I had similar issue, so I copied admin-ajax.php to my theme directory and
   removed the unneeded stuff. Then use it for your ajax calls instead of the wp-
   admin one.
 * Reffer to the file:
 *     ```
       <?php get_template_directory_uri(); ?>/admin-ajax.php
       ```
   
 * This is my admin-ajax.php according the latest WP 3.4.2:
 *     ```
       <?php
       /**
        * WordPress AJAX Process Execution.
        */
   
       define( 'DOING_AJAX', true );
   
       /** Load WordPress Bootstrap */
       require_once( '../../../wp-load.php' );
   
       /** Allow for cross-domain requests (from the frontend). */
       send_origin_headers();
   
       // Require an action parameter
       if ( empty( $_REQUEST['action'] ) )
       	die( '0' );
   
       @header( 'Content-Type: text/html; charset=' . get_option( 'blog_charset' ) );
       @header( 'X-Robots-Tag: noindex' );
   
       send_nosniff_header();
   
       add_action( 'wp_ajax_nopriv_autosave', 'wp_ajax_nopriv_autosave', 1 );
   
       if ( is_user_logged_in() )
       	do_action( 'wp_ajax_' . $_REQUEST['action'] ); // Authenticated actions
       else
       	do_action( 'wp_ajax_nopriv_' . $_REQUEST['action'] ); // Non-admin actions
   
       // Default status
       die( '0' );
       ```
   
 * Hope this helps!
 *  [jtudisco](https://wordpress.org/support/users/jtudisco/)
 * (@jtudisco)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-wordpress-https-ssl-wordpress-https-breaks-ajax-calls-to-admin-ajaxphp/#post-3081567)
 * How about other plugins? This is a good solution for your own code. But what 
   if your not working with your own code. There should be a way to add an exception
   for admin-ajax.php.
 *  Plugin Author [mvied](https://wordpress.org/support/users/mvied/)
 * (@mvied)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-wordpress-https-ssl-wordpress-https-breaks-ajax-calls-to-admin-ajaxphp/#post-3081572)
 * I’ll have a fix out in the next release. If you’d like, try the [development version](http://downloads.wordpress.org/plugin/wordpress-https.zip)
   and let me know if it works for you.
 *  [infobydesign](https://wordpress.org/support/users/infobydesign/)
 * (@infobydesign)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-wordpress-https-ssl-wordpress-https-breaks-ajax-calls-to-admin-ajaxphp/#post-3081573)
 * I’ve been pulling my hair out over this Ajax issue for weeks – after installing
   the Dev version of your plugin, the problem is resolved. Many thanks!
 *  [fluesey](https://wordpress.org/support/users/fluesey/)
 * (@fluesey)
 * [13 years ago](https://wordpress.org/support/topic/plugin-wordpress-https-ssl-wordpress-https-breaks-ajax-calls-to-admin-ajaxphp/#post-3081629)
 * Just to let people know that installing the Dev version (3.4.0b) still fixes 
   this problem, with no settings changed. Great plugin by the way.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘[Plugin: WordPress HTTPS (SSL)] WordPress HTTPS breaks AJAX calls to 
admin-ajax.php’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wordpress-https_bec2c9.svg)
 * [WordPress HTTPS (SSL)](https://wordpress.org/plugins/wordpress-https/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordpress-https/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordpress-https/)
 * [Active Topics](https://wordpress.org/support/plugin/wordpress-https/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordpress-https/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordpress-https/reviews/)

## Tags

 * [admin-ajax.php](https://wordpress.org/support/topic-tag/admin-ajax-php/)
 * [ajax](https://wordpress.org/support/topic-tag/ajax/)
 * [HTTPS](https://wordpress.org/support/topic-tag/https/)
 * [SSL](https://wordpress.org/support/topic-tag/ssl/)

 * 5 replies
 * 6 participants
 * Last reply from: [fluesey](https://wordpress.org/support/users/fluesey/)
 * Last activity: [13 years ago](https://wordpress.org/support/topic/plugin-wordpress-https-ssl-wordpress-https-breaks-ajax-calls-to-admin-ajaxphp/#post-3081629)
 * Status: resolved