{"id":4374,"date":"2019-01-16T10:47:00","date_gmt":"2019-01-16T15:47:00","guid":{"rendered":"http:\/\/lisa.rushworth.us\/?p=4374"},"modified":"2019-01-19T18:32:59","modified_gmt":"2019-01-19T23:32:59","slug":"wordpress-5-autosave-issue","status":"publish","type":"post","link":"https:\/\/www.rushworth.us\/lisa\/?p=4374","title":{"rendered":"WordPress 5 AutoSave Issue"},"content":{"rendered":"\n<p>I upgraded to WordPress 5 back when it was still in preview, and wasn&#8217;t shocked to find some issues. When I would create a post, WordPress would go into an auto-saving loop. Now I like the idea of background saves to prevent data loss if by browser falls over &#8230; but the instant the auto-save would complete, another would kick off and the editor was basically unusable (copy content \/ refresh page \/ paste content \/ cross fingers that the auto-save loop didn&#8217;t happen that time). I tried setting the auto-refresh interval in the config file, but that had no impact. <\/p>\n\n\n\n<p>With the 5.0.0 release, I was dismayed to find the problem lingering but 0.0 releases usually have some quirks too. But two dot-dot releases later, and a lot of frustration that auto-save has caused waaaay more data loss in six months than <em>years<\/em> worth of browser glitches ever managed, I started researching the problem to find a solution other than &#8220;wait for the next release to fix it&#8221;. <\/p>\n\n\n\n<p>I came across an <a rel=\"noreferrer noopener\" aria-label=\"issue on GitHub (opens in a new tab)\" href=\"https:\/\/github.com\/WordPress\/gutenberg\/issues\/9220\" target=\"_blank\">issue on GitHub<\/a> which not only reports the same issue, but included a bit of code to add to the theme functions.php file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>add_filter( 'block_editor_settings', 'jp_block_editor_settings', 10, 2 );\n\nfunction jp_block_editor_settings( $editor_settings, $post ) {\n\t$editor_settings['autosaveInterval'] = 2000; \/\/number of second [default value is 10]\n\n\treturn $editor_settings;\n}<\/code><\/pre>\n\n\n\n<p>And my WordPress is usable again!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I upgraded to WordPress 5 back when it was still in preview, and wasn&#8217;t shocked to find some issues. When I would create a post, WordPress would go into an auto-saving loop. Now I like the idea of background saves to prevent data loss if by browser falls over &#8230; but the instant the auto-save &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[30],"tags":[52],"class_list":["post-4374","post","type-post","status-publish","format-standard","hentry","category-system-administration","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/4374","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4374"}],"version-history":[{"count":1,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/4374\/revisions"}],"predecessor-version":[{"id":4375,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/4374\/revisions\/4375"}],"wp:attachment":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4374"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4374"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4374"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}