How do I disable the warning “The backup of this post in your browser is different from the version below”?

The way to avoid this error is to make sure the wp-saving-post cookie is being set to a value of [post id]-saved, as seen here. As you can see, if that occurs, then WordPress won’t complain about the difference, because it then knows that the post was saved properly.

Also take a look at this line and note that WordPress handles this for you already. So the error you’re seeing, it likely has to do with some mild cookie corruption in your browser.

I ran several tests with your plugin and I was unable to reproduce the issue that you reported. So my feeling is that you should clear all browser cookies for your domain and eliminate the possibility of corruption causing the problem. Also be sure to do a review of WordPress config settings related to cookie storage. If there’s something wrong with cookie settings on your site, it may have an impact on the behavior that you’re seeing when running tests against this.

Finally, check to be sure you’re not filtering the content, and then immediately redirecting, or exiting the script, or doing something else that would prevent this line from running once your filter is applied. That too, may lead to the problem that you’re seeing.