
WordPress autosave fires every 60 seconds. Each time it runs, it saves a new revision of whatever post you’re editing. Edit a blog post for an hour and you’ve stacked up 60 revisions in your database. Do that across a few hundred posts and your wp_posts table gets huge fast.
To disable autosave in WordPress, you have three options: edit wp-config.php, drop a snippet into functions.php, or install a plugin. All three take about 5 minutes. The real difference is how permanent you want the change to be.
Below you’ll find the exact code for each method plus a comparison table at the end. Everything works with the Classic Editor, Gutenberg, and page builders like Elementor.

Autosave is WordPress’s safety net. Every 60 seconds while you’re editing, it saves a temporary copy of your post. If your browser crashes or your Wi-Fi drops, you can recover the last autosaved version. Sounds useful, right?
It is, until you look at what it does to your database over time:
wp_posts. Thousands of revision rows pile up over months. I’ve seen sites where the revisions table was 10x larger than the actual content.Heads up: Once you disable autosave, WordPress won’t save anything in the background. Get in the habit of hitting “Save Draft” or “Update” regularly. I’ve lost a 2,000-word draft before because I forgot. Don’t be me.
Methods 1 and 2 mean editing PHP files. One wrong character in wp-config.php or functions.php and your site goes white. So before you touch anything:
Once you have a backup in place, pick one of the three methods below.
This is the cleanest way to disable autosave in WordPress. The wp-config.php file lives in your WordPress root directory and controls core settings. Unlike theme files, it doesn’t get wiped when you switch themes or update WordPress.
The trick: you set the autosave interval to 86,400 seconds (that’s 24 hours). WordPress technically still autosaves, but only once a day. Nobody edits a single post for 24 hours straight, so it’s effectively off.
Log in to your hosting cPanel or connect via FTP (using FileZilla or similar). Navigate to your WordPress root directory, which is usually /public_html/ or /www/.
No cPanel or FTP? Install the File Manager plugin and browse files right from your dashboard. Handy if your host doesn’t give you direct access, or if you’d rather avoid server-level file editing altogether.
Find the wp-config.php file in the root directory. Right-click and select “Edit” (in cPanel) or download it (via FTP).
Scroll down and find the line that says:
/* That's all, stop editing! Happy publishing. */Add the following code above that line:
// Disable WordPress Autosave (set to 24 hours)
define('AUTOSAVE_INTERVAL', 86400);Save the file and upload it back (if using FTP).
What this does: AUTOSAVE_INTERVAL controls how often WordPress autosaves, in seconds. The default is 60 (once per minute). Setting it to 86,400 pushes it to once every 24 hours, which for all practical purposes means “never.”
Don’t want to kill it entirely? Use a longer interval instead. define('AUTOSAVE_INTERVAL', 300); sets it to every 5 minutes. Good middle ground if you still want a safety net but don’t need 60 revisions per hour.
This one deregisters the autosave JavaScript through your theme’s functions.php. Quick to do, but there’s a catch: switch themes and the code vanishes. Autosave comes right back.
Go to Appearance > Theme File Editor in your WordPress dashboard. From the right sidebar, select Theme Functions (functions.php).
You can also navigate to /wp-content/themes/your-active-theme/functions.php via FTP or cPanel. If you’re using the Master Addons Theme Builder for headers and footers, this still works fine since the Theme Builder doesn’t replace your base theme’s functions file.
Paste the following snippet at the end of the functions.php file:
// Disable WordPress Autosave
add_action( 'admin_init', 'disable_autosave' );
function disable_autosave() {
wp_deregister_script( 'autosave' );
}Click Update File to save.

What this does: wp_deregister_script('autosave') tells WordPress to stop loading the autosave JS file in the admin. No script loaded, no autosave running. Simple as that.
Important limitation: This code lives inside your theme. If you switch to a different theme, the autosave disable code will be gone and autosave reactivates. For a permanent solution that survives theme changes, use Method 1 (wp-config.php) instead. You can also use a Code Snippets plugin to add this code in a theme-independent way.
Not comfortable editing PHP files? Fair enough. The Disable Gutenberg Autosave plugin does the same thing through a settings panel. It’s built specifically for the Gutenberg Block Editor.
Autosave stops the moment you activate the plugin. You can also toggle it back on for individual posts if you want, which is something the code methods can’t do.
Good for client sites: Install the plugin, set it up, and your client never has to think about it. If you’re building client sites with Master Addons and Elementor, the white label feature lets you rebrand the whole dashboard so the client only sees your agency name.
If you’d rather watch than read, this video walks through the wp-config.php and functions.php methods. It shows exactly where to find the files and where to paste the code.
Quick side-by-side of all three methods:
| Feature | wp-config.php | functions.php | Plugin |
|---|---|---|---|
| Difficulty | Easy (copy-paste) | Easy (copy-paste) | Easiest (click-to-install) |
| Survives theme change | Yes | No | Yes |
| Per-post control | No | No | Yes |
| Custom interval | Yes (any seconds) | No (fully disables) | Yes (preset options) |
| Adds a plugin | No | No | Yes |
| Works with Gutenberg | Yes | Yes | Yes (built for it) |
| Works with Classic Editor | Yes | Yes | Gutenberg only |
| Best for | Permanent, site-wide fix | Quick test or single theme | Non-developers, client sites |
For most people, Method 1 (wp-config.php) is the way to go. One line of code, permanent, zero overhead. If you don’t want to touch files, the plugin works well too, especially since it gives you per-post toggling.
Turning off autosave stops the automatic revisions, but WordPress still saves a revision every time you manually click “Save Draft” or “Update.” Those add up too, just more slowly.
You can cap the number of revisions WordPress keeps. Add this to your wp-config.php, right next to the autosave line:
// Disable Autosave (set to 24 hours)
define('AUTOSAVE_INTERVAL', 86400);
// Limit post revisions to 3 per post
define('WP_POST_REVISIONS', 3);WordPress now keeps only the 3 most recent revisions per post. Older ones get deleted on their own. You can change the number to whatever you want. Setting it to false kills revisions entirely, but I wouldn’t do that unless you have a rock-solid backup system.
These two lines together make a noticeable difference on the database side. If you’re following SEO best practices for Elementor, a leaner database feeds directly into better page speed and Core Web Vitals numbers.
While you’re cleaning up the admin side of things, WP Adminify is worth a look too. It reorganizes the WordPress dashboard into something that actually makes sense.
Totally safe. Autosave is a convenience feature, not something WordPress needs to function. The only downside is you could lose unsaved work if your browser crashes mid-edit. Just get in the habit of clicking “Save Draft” regularly, and keep a backup plugin running as a safety net.
Nope. Elementor, Beaver Builder, Divi, and Master Addons for Elementor all have their own save systems. They don’t depend on WordPress’s built-in autosave at all. Turning it off might actually help if you’ve been seeing weird save conflicts in your page builder.
It helps in two spots. One, it kills the AJAX request that fires every 60 seconds while you’re editing. Two, fewer revisions means a smaller database. On a site with hundreds of posts, cleaning up old revisions can shrink wp_posts by a surprising amount. More performance ideas in our Elementor speed guide.
Yes. In the wp-config.php method, change the number to your preferred interval in seconds. For example, define('AUTOSAVE_INTERVAL', 300); sets autosave to every 5 minutes. The Disable Gutenberg Autosave plugin also offers preset interval options directly in the editor.
Disabling autosave only stops new revisions from piling up. The old ones are still there. Use WP-Optimize or Advanced Database Cleaner to bulk-delete existing revisions, auto-drafts, and trashed posts. Back up your database first. If something goes wrong and you hit a server error after cleanup, that backup is your lifeline.
That’s the whole thing. Five minutes of work to disable autosave in WordPress and your database stays clean going forward. The wp-config.php method is permanent and survives everything. The functions.php method is quick but goes away if you change themes. The plugin gives you a toggle without touching code.
If you add the post revision limit from the bonus section too, you’ve basically done the easiest database optimization you’ll ever do. Pages load faster, the admin feels snappier, and phpMyAdmin stops making you nervous.
Questions about WordPress optimization or want to see what Master Addons can do for your Elementor site? Drop us a line.
Related reading: How to Speed Up Elementor Websites | Best WordPress Backup Plugins | Best SEO Practices for Elementor | WordPress Admin Dashboard Plugin
Get all the premium widgets and templates you desire, built with clean code that keeps your site fast. Ditch the bloat, not the features.

110+ Premium Widgets & Lifetime Updates – Build Beyond Limits. An Exclusive Creation by Pixar Labs
Every Master Addons Pro license comes with a 14-day no-questions refund, lifetime updates, and priority support. Try it risk-free this Spring – 40% OFF with “RESET40″ coupon.