Title: content_save_pre creates &#8220;The backup version&#8221;&#8230; Warning
Last modified: October 2, 2016

---

# content_save_pre creates “The backup version”… Warning

 *  [suntower](https://wordpress.org/support/users/suntower/)
 * (@suntower)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/content_save_pre-creates-the-backup-version-warning/)
 * I have a small filter below. It does a regular expression replace of a particular
   string when the user saves the draft.
 * However, using this filter causes the warning “The backup of this post in your
   browser is different from the version below.”
 * Is there a way to ‘tell’ WordPress not to display the warning when that filter
   runs?
 * To re-create:
 *  1. Create a draft post.
 *  2. In the body, enter a line of text:
 *  rcq[whatever]
 *  eg.
 *  rcqTestMsg
 *  3. Save the draft.
 * Here is the code.
 * UPDATE: WHAT I THINK IS GOING ON: I think that somehow this is triggering the
   autosave.js CheckPost() function which (apparently) compares the text on screen
   with the current saved version. Is there a way to disable the autosave or revision
   just when this filter is triggered? Or is there something in my code that is 
   confusing the revision system?
 *     ```
        function jchwebdev_rant_quote_question( $content ) {
           global $post;
           $pattern = '/rcq/';
           $replacement = '<span class="interview initials">RC</span>$1';
           if ($post->post_status == 'draft') {
             return preg_replace($pattern, $replacement, $content);
           }
           else
             return $content;
         }
         add_filter( 'content_save_pre' , 'jchwebdev_rant_quote_question' , 10, 1);
       ```
   

The topic ‘content_save_pre creates “The backup version”… Warning’ is closed to 
new replies.

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 0 replies
 * 1 participant
 * Last reply from: [suntower](https://wordpress.org/support/users/suntower/)
 * Last activity: [9 years, 10 months ago](https://wordpress.org/support/topic/content_save_pre-creates-the-backup-version-warning/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
