Title: Ajax edit does not work because it&#8217;s not https
Last modified: August 29, 2019

---

# Ajax edit does not work because it’s not https

 *  Resolved [chexone](https://wordpress.org/support/users/chexone/)
 * (@chexone)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/ajax-edit-does-not-work-because-its-not-https/)
 * Hello,
    I can not update Titles and Descriptions from the Page listing using 
   the ajax functionality. In console I get the error:
 * > Mixed Content: The page at ‘[https://raver.life/wp-admin/edit.php?post_type=page&#8217](https://raver.life/wp-admin/edit.php?post_type=page&#8217);
   > was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint ‘[http://raver.life/wp-admin/admin-ajax.php&#8217](http://raver.life/wp-admin/admin-ajax.php&#8217);.
   > This content should also be served over HTTPS.
 * As you can see in the source, the requestUrl specified in var aioseopadmin is
   https rather than https. How can I change this to https?
 *     ```
       <script>
       if (document.location.protocol != "https:") {
           document.location = document.URL.replace(/^http:/i, "https:");
       }
       </script>
       <script type='text/javascript' src='https://raver.life/wp-includes/js/tw-sack.min.js?ver=1.6.1'></script>
       		<script type="text/javascript">
       			//<![CDATA[
       			var aioseopadmin = {
       				blogUrl: "https://raver.life",
       				pluginUrl: "http://raver.life/wp-content/plugins/all-in-one-seo-pack/",
       				requestUrl: "http://raver.life/wp-admin/admin-ajax.php",
       				imgUrl: "http://raver.life/wp-content/plugins/all-in-one-seo-pack/images/",
       				Edit: "Edit",
       				Post: "Post",
       				Save: "Save",
       				Cancel: "Cancel",
       				postType: "post",
       				pleaseWait: "Please wait...",
       				slugEmpty: "Slug may not be empty!",
       				Revisions: "Revisions",
       				Time: "Insert time"
       			}
       			//]]>
       		</script>
       ```
   

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

 *  [Michael Torbert](https://wordpress.org/support/users/hallsofmontezuma/)
 * (@hallsofmontezuma)
 * WordPress Virtuoso
 * [6 years, 9 months ago](https://wordpress.org/support/topic/ajax-edit-does-not-work-because-its-not-https/#post-11880845)
 * Make sure you have https for your WP address and site address General Settings
   [https://wordpress.org/support/article/settings-general-screen/](https://wordpress.org/support/article/settings-general-screen/)
 *  Thread Starter [chexone](https://wordpress.org/support/users/chexone/)
 * (@chexone)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/ajax-edit-does-not-work-because-its-not-https/#post-11880861)
 * I do already have those set to https.
    It’s a multi-site WP setup, so it doesn’t
   look like your screencap though. Maybe I have missed a place in the database…
 *  Thread Starter [chexone](https://wordpress.org/support/users/chexone/)
 * (@chexone)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/ajax-edit-does-not-work-because-its-not-https/#post-11880876)
 * Nope, all looks good in the database.
    Not sure where it’s getting those ‘http’
   values
 *  [Michael Torbert](https://wordpress.org/support/users/hallsofmontezuma/)
 * (@hallsofmontezuma)
 * WordPress Virtuoso
 * [6 years, 9 months ago](https://wordpress.org/support/topic/ajax-edit-does-not-work-because-its-not-https/#post-11880883)
 * It’s not my screencap. That’s the WordPress documentation on General Settings.
 * [Our code](https://github.com/semperfiwebdesign/all-in-one-seo-pack/blob/97e607c881d2493a84b0a246dba4475be932f7b4/inc/aioseop_functions.php#L284)
   gets the URL directly from the settings in WP using the [get_bloginfo( ‘url’ )](https://developer.wordpress.org/reference/functions/get_bloginfo/)
   and [site_url](https://developer.wordpress.org/reference/functions/site_url/)
   functions.
 * _‘url’ – The Site address (URL) (set in Settings > General)_
    -  This reply was modified 6 years, 9 months ago by [Michael Torbert](https://wordpress.org/support/users/hallsofmontezuma/).
 *  Thread Starter [chexone](https://wordpress.org/support/users/chexone/)
 * (@chexone)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/ajax-edit-does-not-work-because-its-not-https/#post-11885147)
 * Thank you for the detailed information. I was able to trace through the code.
   It looks like site_url() is not returning https as the default scheme.
 * If I force site_url() to use https, then the ajax update works in the admin.
 * all_in_one_seo_pack.php
 *     ```
       if ( ! defined( 'WP_ADMIN_URL' ) ) {
       	define( 'WP_ADMIN_URL', site_url('','https') . '/wp-admin' );
       }
       ```
   
 * Sounds like I need to figure out why site_url() is returning the http scheme 
   rather than https.
 *  Thread Starter [chexone](https://wordpress.org/support/users/chexone/)
 * (@chexone)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/ajax-edit-does-not-work-because-its-not-https/#post-11888381)
 * I traced the root cause of this to is_ssl() not working on my system. Probably
   because of the load balancer. If I force is_ssl() to return true, the problem
   goes away. Nothing wrong with the plugin, thanks for the help.

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

The topic ‘Ajax edit does not work because it’s not https’ is closed to new replies.

 * ![](https://ps.w.org/all-in-one-seo-pack/assets/icon.svg?rev=2443290)
 * [All in One SEO – Powerful SEO Plugin to Boost SEO Rankings & Increase Traffic](https://wordpress.org/plugins/all-in-one-seo-pack/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/all-in-one-seo-pack/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/all-in-one-seo-pack/)
 * [Active Topics](https://wordpress.org/support/plugin/all-in-one-seo-pack/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/all-in-one-seo-pack/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/all-in-one-seo-pack/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [chexone](https://wordpress.org/support/users/chexone/)
 * Last activity: [6 years, 9 months ago](https://wordpress.org/support/topic/ajax-edit-does-not-work-because-its-not-https/#post-11888381)
 * Status: resolved