Remove “Are You Sure” dialogue when leaving editor

Anyone know of a nice way to disable that pop-up dialogue when exiting the post-editor?
It says “This page is asking you to confirm that you want to leave – data you have entered may not be saved.”

Nice feature, but annoying in certain blogs where I have to edit a ton of posts

Related posts

Leave a Reply

3 comments

  1. You can use the method described here. Add the following to your functions.php

    <?php
    function wpse35898_admin_head() {  
        ?> 
        <script type="text/javascript"> 
            window.onbeforeunload = function() {};
        </script> 
        <?php 
    } 
    add_action( 'admin_head' , 'wpse35898_admin_head' ); 
    ?>
    
  2. as this page

    you must to add “autosave_ask_before_unload: false” in init of tinymce(as bottom code):

    tinymce.init({
            mode: 'textareas',
            menubar: false,
            statusbar: false,
            language: 'sv_SE',
            autosave_ask_before_unload: false,
            ...
    

    and you must be add bottom code in your page:

    <script>
    window.onbeforeunload = function() {};
    </script>